Home > Back-end >  File stream to write characters in TXT file, only one character but read 4095? why
File stream to write characters in TXT file, only one character but read 4095? why

Time:11-28



Why do ask next eldest children, that is, if I file inside only one character, I don't write operation, read out is a character, but
To write again after reading the words will be read out is 4095

CodePudding user response:

Should be 4 k, you write to characters' z ', the current cursor backwards one, give you fill behind the 4 k - 1 empty placeholder characters,
If in front with a while loop call: fseek (stream, 0, SEEK_SET); Pointer to reset, the count is 4 k,

Feel this is the place where c standard library very sick, or directly use the open read write good, simple, direct, brutal,,,
  • Related