End of FILE* pointer is not equal to size of written data
问题 Very simply put, I have the following code snippet: FILE* test = fopen("C:\\core.u", "w"); printf("Filepointer at: %d\n", ftell(test)); fwrite(data, size, 1, test); printf("Written: %d bytes.\n", size); fseek(test, 0, SEEK_END); printf("Filepointer is now at %d.\n", ftell(test)); fclose(test); and it outputs: Filepointer at: 0 Written: 73105 bytes. Filepointer is now at 74160. Why is that? Why does the number of bytes written not match the file pointer? 回答1: Since you're opening the file in