Relationship between the return value and pointer position of the fseek file offset position
The pointer offset of the corresponding file is not clearly described in the function definition. When the offset is a positive number, it is offset to the end of the file, when it is a negative number, it is offset to the file header. Here, we need to pay attention to the relationship between the offset size and the file size boundary.
When offset is an offset to the end of a file, fseek returns 0 regardless of whether the offset exceeded the end of the file. When the offset does not exceed the end of the file, the file Pointer Points to the normal offset address. When the offset exceeds the end of the file, the file Pointer Points to the end of the file. The offset error-1 value is not returned.
When offset is offset to the file header, if the offset does not exceed the file header, it is normal offset. The file Pointer Points to the correct offset address, and the return value of fseek is 0. when the offset value exceeds the file header, fseek returns the error-1 value, and the file pointer remains unchanged at the original address.