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
Fstream
Fstream
Oct 2, 2011 at 11:43pm UTC
stevew9948
(6)
I am using fstream to pull a hint from a .txt file i knoow there is the getline coding i just do not know how to use it.
the file i will be pulling from is titles infile.txt what would i need to get information from line 3 5 etc?
Oct 3, 2011 at 12:23am UTC
Zhuge
(4664)
Lines are just sequences of bits. There is no notion of lines, so if you want to read line 3, use getline() repeatedly to get the lines before it before you store the data.
Oct 3, 2011 at 12:25am UTC
stevew9948
(6)
so if it were the first hint (line 3)
cout <<" your first hint is:" getline()getline()getline()
??
Last edited on
Oct 3, 2011 at 12:26am UTC
Topic archived. No new replies allowed.