I have a game that requires me to save alot of info to a txt file.

The problem is, I must store all the individual things into separate txt files because I have no idea how to get c++ to read individual lines of a file.

For example - I want to have a txt file like this:
line 1 = money
line 2 = lives
line 3 = respect points

So if I needed c++ to grab the # of lives a player has I would tell it:
"look on like #2 and save that info to a variable"

Thanks so much!

You are talking about a text file access through C++ and you should know that for it there is no concept of line,its just a stream of characters and the compiler knows that it should print the characters following '\n' character in the next line.
Using this '\n' as a line delimiter getline() function has been designed.
After knowing how it works you can design your own function to suffice your needs.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.