problem while file read
Hello,
I think it is very silly, but i couldnt trace out the problem.
I am trying to read 3 lines from file using fgets, then using fseek i m placing the pointer back one line.
But after that when i do fgets i m not getting the complete line.Instead first 3 charecters are missing.
My code looks like
for(i = 0; i < 3; i++)
fgets(strBuf,500,fpInFileNext);
cnt = strlen(strBuf);
fseek(fpInFileNext,-(cnt),SEEK_CUR);
fgets(strBuf,500,fpInFileNext); // now strBuf contains line with
3 missing charecters.
What may be the problem?????????
Cheers,
|