Fstream

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?
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.
so if it were the first hint (line 3)


cout <<" your first hint is:" getline()getline()getline()


??
Last edited on
Topic archived. No new replies allowed.