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
Basic file input/output!
Basic file input/output!
Aug 27, 2010 at 9:23am UTC
xander333
(641)
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?
Aug 27, 2010 at 9:26am UTC
Skillless
(227)
http://cplusplus.com/doc/tutorial/files/
Youre probably looking for getline or something like that
Aug 27, 2010 at 9:33am UTC
xander333
(641)
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?
Aug 27, 2010 at 10:28am UTC
Skillless
(227)
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
Aug 27, 2010 at 10:29am UTC
Topic archived. No new replies allowed.