Hi,
I have a similar problem. I need to read and store information from a file such as:
in int count=7; //count
int float end = 7.5 ; //end
out float myout =0; //my out
I need to store type(e.g. in or out), variable type (e.g. int), variable name (e.g. count), and variable value (e.g. 7). The main problem is that the "=" sign could be joined to the code, as in the first example, or separated by spaces.
Can you please show me how can I do that?
fstream will skip white space for you -- you don't have to do a thing
ifstream in("filename"); string word; int val1, val2; while( in >> word >> val1 >> val2) { // do something with these values }