Hey guys.
I saw that if you use:
fseek(fp, 0, SEEK_END)
It find you the beginning of the last line in a file.
Does it mean the last EMPTY line? or the last line like this:
if I have a file and it looks like this
Code:
Counter-Strike 1.6 is old
Call of Duty is newer
will it find the beginning of the line "Call of Duty is newer" or the beginning of the last line HERE?:
Code:
Counter-Strike 1.6 is old
Call of Duty is newer
// here??
The reason I want to know is, that I want everytime that something new will be added to a file. So what I want to do is fseek to a NEW LINE, then fputs something. and as far as I know if I use fputs it just erases the first line (or wherever the cursor pointer is found at) and overwrites it with the string parameter you gave.
How can I use fseek to write a new line at the end of the file with fputs? (except of course with using many fgets while !feof, cuz fgets moves the pointer automatically)
__________________