I will summarize the C standard (C99) function.

xiaoxiao2021-03-06  64

Function: #include Void Clearer (File * Stream); Function: Clearerr () Points the file error flag points to the stream (value 0), and the file's tail mark is also reset. The file error flag of each stream is initialized by the successful fopen () call. Function: #include Void Perroe (const char * STR); Function: Call PERROR () to determine the nature of the error. Peror () maps the value of the global variable Error to a string, and then the string is written on the stream STDER. If the Str is not empty, write the STR string first, then write a colon, then write an error message related to reality. Function: int Fclose (File * Stream); Function: Turn off the file contact with the streaming stream and the buffer clearance. After calling fclose (), Stream is detached from the file to release the automatic allocated buffer. Returns 0 when successful, otherwise not 0. Error will use a variety, close the closed file, the remaining space is not enough, .... Function: int feed (file * stream); Features: Check the file location indication, which determines whether or not to reach the file in the file associated with Stream. Returning non-0 at the end of the file, otherwise returns 0. Function: int Ferror (File * stream); Features: Ferror checks file errors on the settlement stream. Non-0 indicates a fault, and the correct property of the error is determined by PERROR. Function: int fflush (file * stream) function: If the file associated with the reigning flow is "Write open", you should call FFLUSH () to write the contents of the content in the output buffer; if the file is "read open" , Fflush () clears the contents of the input buffer. Function: int FGETC (File * Stream) function: Returns the next character of the input stream current location and points the file location to 1. Function: int FGETPOS (FILE * STREAM, FOPS_T * POSITION); Function: For the specified stream, the function fgetpos () puts the file location indicator to the object pointing to the position. The object pointing to the Position must be a variable of the fpos_t type, and it is only useful when you subsequently call FGETPOS (). Function: Fize_t Fread (Void * BUF, SIZE_T SIZE, SIZE_T Count, Filfe * Stream) Function: Read the count object from the Stream, each object is long as a size byte, and the read result is placed in the array pointed to by BUF. . The location of the file indicates that the corresponding byte position is advanced in front of the reading byte. In C99, BUF and stream are modified by restrict. Function: File * Freopen (const char * fname, const char * model, file * stream); Function: Freopen () The existing stream is connected to another file. The new file name is specified by the FNAME, the access method is specified by Mode, and the redistributed stream is specified by the stream. The valid value of Mode is the same as that in FOPEN (). In C99, the same fname, mode, and stream is modified by restrict.

Function: int Fscanf (file * stream, const char * format, ...) Features: It is fully similar to scanf (), but information is read from the stream specified by Stream, instead of reading in stdin. In C99, Stream is Restrict is modified. Returns the actual value of the change in the value, where it is not calculated, returning EOF is indicated to the first variable element assignment before it is wrong. Function: int FSeek (long int offer: Follow the OFFSET and Origin Value Settings The File Location Indicator associated with the stream Stream is to support random access I / O operations. Where: Offest is the number of bytes that origiin starts to find. The value of the values ​​defined in stdio.h must be the macro value defined in stdio.h. Seek_set --------- From the beginning of the file; seek_cur --------- from the current file; seek_end --------- Address from the end of the file Function: int FSETPOD (File * Stream, const fpoE_t * position); Function: Move the file's location indication to the point you refer to the object. The value of the Position object must be used in advance with FGETOPS (). Function: long int Ftell (File * Stream); Function: Returns the current file location value of the specified stream. For binary stream, this value is the number of bytes calculated from the file. For text streams, in addition to making FSEEK () may be completely Significance, because there is a possibility of character transformation. Function: size_t fwrite (const void * buf, size_t size, size_t count, file * stream); function: Write the count object in the character array pointed to the BUF to the stream stream, each The object length is Size byte. In C99, BUF and stream are modified by restrict. Function: Int Remove (const char * fname); Function: Delete files with the fname string are named. Successful return 0. Function: int Rename (const char * oldfname, const char * newfname) Features: Put the name of the file by Oldfname Change to newfname. Success return 0; function: Void Rewind (file * stream); function: Move the file location to the beginning of the specified stream, and clear the file tail flag and error flag associated with the stream. Function: void setbuf (FILE * STREAM, CHAR * BUF) Function: When the BUF is an empty pointer, setbuf () stops the buffer processing of the streaming Stream; the setBUF () set the stream of the stream as the area referred to as BUF. Function: int setvbuf (File * Stream, Char * BUF, INT MODE, SIZE_T SIZE); Function: Allows the size of the buffer, the size and buffer of the buffer to the specified stream. Function: int Snprintf (Char * Restrict BUF, Size_t Num, Const Char * Restrict Format, ...); Function: This function is added in C99. Almost and sprintf () is identical. Function: int sscanf (const charf, const char * format, .. .....); Function: Same as scanf (), but SSCANF () is read from the array pointing from BUF and is not read from STDIN. In C99, BUF and Stream are modified by restrict. Function: File * TMPFile (VIOD); Function: Open a temporary binary for read and write operations and returns a pointer to the stream. The file automatically constructs the unique file name so that it is not conflict with existing files. Function: char * tmpname (char * name); Function: Generate a unique file name, the result is placed in the character array Name.

转载请注明原文地址:https://www.9cbs.com/read-112979.html

New Post(0)