To write/read data in file

Hi, i will write and read the data in file like so:
1
2
VALUE1=0
VALUE2=blablabla

I see such ways:
1. To read file in string with getline(). To read string by char until '=' to find. Then to compare the name of variable.
2. Same, but to limit the length of name.
3. To use "magic number": the program read the specified string in file and ignore the name.
*
Maybe is something better?
Last edited on
You are correct.
1. Use getline() to read until '='

2. Use getline() to read until '\n'

3. Loop the steps 1 & 2 until there is nothing more it can read.
Last edited on
thank
Topic archived. No new replies allowed.