read data from file

Hello all,

I am quite new to C++ so my question might be very basic.

I am now trying to read data from a file in the format of:

A=524 B=14 C=89

Is there some way to just read the data out of the file?

A step forward, if I want to read these three data items into variables A, B and C in the code, is it possible?

Regards,
Greene
It depends on how the data is stored. If this is stored as just ASCII characters, you can read each line into a string, then parse out each field for whatever purpose you have.
Maybe you can try this tutorial
http://www.cplusplus.com/doc/tutorial/files/
Hope this helps.
Topic archived. No new replies allowed.