Is something like this legal? It doesn't work right now, but is it possible to do something like this?
Code:#include <iostream>
#include <fstream>
using namespace std;
int main()
{
char c[51];
fstream infile("64.237.35.121:78");
if (!infile)
cout << "Can't open address" << endl;
infile << "BARF" << endl;
while (infile >> c)
cout << c;
cin >> c;
return 0;
}