I have a file "data.txt" with following content
Code:
mark zuckerbergsiliconvalcalifornia
jimmy wales london unitedking
As you can see every record is on new line and size of each record is 40.Now when i directly try to go to location 45 with this below function..
Code:
ifstream ifile("data.txt");
ifile.seekg(45,ifile.cur);
it does not take me to the location 45.it takes some arbitrary position.
As file contents change the arbitrary location changes.
Considering the above example of file contents,what is the correct
method to go to location "45" which has the letter y.