Fgets (read a string from the file)Related functions: open, fread, fscanf, GETCHeader file include Define the function char * fgets (char * s, int size, file * stream );Function Description: fgets () is used to read characters from the file referred
fopen ()and the use of fclose ()1. The use of the fopen () functionThe fopen function is used to open a file in a format that is: File *fopen (char *filename, *type); The first form parameter in the fopen () function represents the file name, which
fopen () and the use of fclose ()1. The use of the fopen () functionThe fopen function is used to open a file in a format called:FILE *fopen (char *filename, *type);The first form parameter in the fopen () function represents a file name, which can
Fopen ()And fclose () Usage
1. usage of the fopen () function
The fopen function is used to open a file. The call format is:
FILE *fopen(char *filename, *type);
The first form parameter in the fopen () function represents the file name, which can
Open/close/refresh Stream1. fopen () Open streamFunction:1) fopen () opens a file specified by path.2) Fdopen () gets a first file descriptor and combines a standard I/O stream with the description. This function is commonly used for descriptors
File file stream for fast operation of files, the main operation functions are fopen, fseek, Fread, Fclose, when the structure of the file is relatively clear when using these functions will be relatively quick to get the file location of the data,
fopen
Function prototype FILE * fopen (const char *path,cost char *mode)
Action: Opens a file that returns a pointer to the file
Parameter description: The first parameter is the file path and file name to open the file, and the second parameter
Phpfile_put_contents () function (integrated with fopen, fwrite, and fclose). For more information, see. Command: file_put_contents ();
Command parsing: file_put_contents (PHP 5)
File_put_contents -- write a string to a file
Note:
Int
1. fopen
FILE * fopen (const char * path,const char * mode); function Description
The parameter path string contains the file path and filename you want to open, and the parameter mode string represents the flow pattern.
Mode has the following
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.