Jump to content

fseek()


IamTK

Recommended Posts

How do i use Fseek() without having fwrite() replace whatever's there before?Like I want to seek the pointer to a certain spot, then use fwrite to write something there without replacing what's there already.And how do I move the pointer down instead of just to the right? Fseek only moves the pointer to the right on the same line of code, I want to be able to move up and down rows, how can i do that?Edit: No help? Do I need to make this more clear?

Link to comment
Share on other sites

How are you opening the file? The fwrite function behaves differently with the different modes of opening the file.Also, files do not have rows. A file is a string of bytes. If you have a file with 3 lines in it, it looks like this:line 1\nline 2\nline 3There aren't any "rows" in the file, just a sequence of characters. If the text reader gets to a newline character then it will display it as a line break, it doesn't mean that in the actual file one line ends and another one begins, a newline is just a normal character like any other character.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...