I have a text file looks like this :
100 50 20 90
4.07498 0.074984
37.1704 28.1704
20.3999 14.3999
48.627 35.627 ....
I need to edit this file so that everything is kept the same except the first line, 3rd item. The ouput should look like this:
100 50 19 90
4.07498 0.074984
37.1704 28.1704
20.3999 14.3999
48.627 35.627
....
How can I do it in c++ ? Can anybody help me?
Thanks,
Hoang
Edit: The above was of course mostly a joke. The real way to do it is to read the first line, split it into parts, change the required number, write it out, then follow with all the rest of the lines. If we know that the file contains four integers (floats?) on the first line, something like this might suffice: