cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
read data from file
read data from file
Aug 26, 2011 at 7:22pm UTC
greene
(1)
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
Aug 26, 2011 at 8:08pm UTC
kooth
(746)
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.
Aug 26, 2011 at 8:22pm UTC
TheMassiveChipmunk
(259)
Maybe you can try this tutorial
http://www.cplusplus.com/doc/tutorial/files/
Hope this helps.
Topic archived. No new replies allowed.