In particular, the getline() method of the ifstream class which lets you read n characters until a specified delimiter.
Like so:
ifstream in("script.x");in.getline(buffer, MAX_CMD_LEN, ' ');
Also, the fstream classes are a bit more intuitive when it comes to input/output since they provide overloaded operators for << and >>.
Like so:
ifstream stream("script.x");int arg1, arg2;stream.getline(strCommand, MAX_CMD_LEN, ' ');stream >> arg1 >> arg2;
Of course that is just pseudo code without any error checking what so ever. If you want to be really serious you should think about writing a tokenizer...
Hope it sheds some light