04.06.2017, 21:39
Last line first, or completely reversed?
Imagine this is the content of your file:
Should it become:
or:
It's also important to know how long the file is. If it's not too big it's easy to use a buffer and then go through that in reverse (either line by line or character by character). Otherwise you must use fseek and fgetchar. fseek has different modes you can take advantage of.
Imagine this is the content of your file:
Код:
hello test
Код:
tset olleh
Код:
test hello