I have phone.txt like:
09236235965 09236238566 09238434444 09202645965 09236284567 09236235965 ..and so on..
How can I process this data line by line in C ++ and add it to a variable.
string phonenum;
I know that I need to open the file, but after that, what is done to access the next line of the file?
ofstream myfile; myfile.open ("phone.txt");
and also about the variable, the process will be looped, it will make the phonenum variable the current line of its processing from phone.txt.
As if the first line is being read by phonenum - the first line, processes everything and the loop; now phonenum is the second line, processes everything and cyclically to the end of the last line of the file.
Please, help. I am really new to C ++. Thanks.
source share