I have a problem with that
going back in cursor's position by a few Lines
I've tested fseek(fp, -127, -4// back four lines) - but it didn't work could you help me please.
I have a problem with that
going back in cursor's position by a few Lines
I've tested fseek(fp, -127, -4// back four lines) - but it didn't work could you help me please.
First of all you don't seem to be passing the correct arguments to fseek
(more specifically the last argument). Secondly, lines in text files are seldom of a fixed width, so you can't use a specific number to go back "four lines".
Instead you have to seek backward one character at a time to find the correct spot. This is not very effective using seek functions, and depending on the file you might want to either