guys, when you use "fputc" does it write the data to storage or to the internal buffer? I ask because updating the storage and file size seems excessive for one byte?
Last Edited: Thu. May 5, 2022 - 10:37 PM
guys, when you use "fputc" does it write the data to storage or to the internal buffer? I ask because updating the storage and file size seems excessive for one byte?
Doesn't the f stand for file? And of course the "file"can be anything from what I remember.
It would normally be buffered, depending on the exact type and disposition of the file.
Buffered data (for typical disk-like files) will actually be written when the buffer fills, or when you close the file, or perhaps in the case of some other operations (fflush(), maybe fseek(), etc.)
This is why you should make sure your program doesn't crash before you've closed the files!