Dear All,
i have a txt file which have the following data:
data1
data2
(new line but with nothing type,i.e. the cursor can move to this line)
i discover that when the point moved to the third line, i cant get back to the beginning of the file even i use file.seekg(0,ios::beg)
while i can when the pointer never reach line 3.
here is my code and output if you dun understand:
[code]
cout << file7.tellg() << endl;
file7.ignore(500,'\n');
file7.ignore(500,'\n');
file7.getline(RFQ,14);
cout << "||" << RFQ << "||" <<endl;
file7.seekg(0,ios::beg);
cout << file7.tellg() << endl;
file7.getline(RFQ,14);
cout << "||" << RFQ << "||" <<endl;
file7.seekg(0,ios::beg);
cout << file7.tellg() << endl;
file7.close();
[\code]
output:
0
||||
0
||||
0
how to solve the situation??
thanks!!