- Created Thursday, March 20th 2014 @ 02:34:55
the standard input and output channels are 'cin>> "command from server";' and 'cout<< "command to server";'
am i correct in saying this? I just want to know what the standard input, output channel is for c++ and their syntax.
any help is appreciated
DeveloperCreated Thursday, March 20th 2014 @ 08:48:39
That's correct, you'll be using cin and cout to communicate between your bot and the game server when developing in C++.
yamitenshiCreated Wednesday, April 2nd 2014 @ 12:47:08
For testing purposes you can also pass a reference to an std::istream and an std::ostream object to your bot so you can provide input and output files (what I do is use commandline args for an input and output filename, open the file in main() and pass a reference to either the file or std::cin/std::cout respectively). Then your bot can just do
inFile >> commandFromServer;
outFile << commandToServer;
and it will end up using the correct I/O streams.