Basic file input/output!

Hey forum,

I'm wondering if it's possible to read a piece of a text file and assign it to a variable? I looked at the documentation about it here but can't seem to find it?
http://cplusplus.com/doc/tutorial/files/
Youre probably looking for getline or something like that
I don't know, can I assign that to a var? And how do I set where to start/stop? I that with the put function?
Well, getline reads 1 line of a file, and then stores that in a string,
you can also use ifstream.read to read a fixed amount of chars..

you should really read the whole page of the tutorial about files..
Last edited on
Topic archived. No new replies allowed.