1 stdio.h is the standard input and output library in the C standard library
2 methods that are called in C + +
Call it directly, but it's best to precede the function name with:: To show the inner function of the area classification and the C standard library function.
3 c use of standard input and output libraries
3.1 Core structure
File Structure Body
When you open a file, you get it, and then you don't have to worry about it.
3.2 Core Approach
3.2.1 Fopen
The first string is the path to the file.
The second argument is a string that represents the mode in which the file is manipulated, and "RB" means read binary, which reads the file in binary form.
3.2.2 Fseek
The first parameter is a file struct pointer.
The second parameter and the third parameter are used to set the position of the file read-write location pointer, where the third parameter is the origin, and the second parameter is the offset. Two parameters together with more flexibility to control the position of reading and writing position pointers.
The third argument can be Seek_set (the beginning of the file), Seek_end (the end of the file).
3.2.3 Ftell
Gets the position of the file read-write pointer, counting from 0. For example, if the file read-write pointer to the beginning of the file, then the return value of the function is 0.
The file read and write pointer before the data is already read, if the file read and write pointer is 0, then that is not started to read the data, if the file read and write pointer to Seek_end, then the document has been read. Therefore, the size of the file read-write pointer is the size of the data that has been read. If the file read-write pointer is seek_end, then the file is read, then the size of the file read-write pointer is the size of the file.
Summary of file operations in the C + + standard library