Reading lines one by one on notepad

I am making a saving system and for this reason, I need to read some number out of it, that's why.

I want to get out the number from each line (y, x, z)

and example, if those lines get's called a, b, c - I want to put each line back on the y, x and c, like normal saving system.

so a = y, b = x, c = z, where a is the first line, b is the second line and c is the third line.

This is my saving code:

1
2
3
4
      ofstream myfile;
    myfile.open ("savefile.txt");
    myfile << y << "\n" << x << "\n" << z;
    myfile.close();


Thanks for all suggestions.
Last edited on
Where are you declaring your variables?
Top of the codding.

int c; // chances
int nn; // double chance
int n; // second command
int x = 5; // pokeballs
int y; //pokemons
int z; // cash
Last edited on
Topic archived. No new replies allowed.