/*========================================================== ==========================================Name: quanhaunchong. cAuthor:Version:Copyright: Your copyright noticeDescription: Hello world in C, ANSI-style=====================================
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
C-language Lseek () function: Moving a file's read/write location
Header file:
#include #include
To define a function:
off_t lseek (int fildes, off_t offset, int whence);
Function Description:Each open file has a
Http://blog.sina.com.cn/s/blog_61437b3b0102v0bt.htmlhttp://blog.csdn.net/chenwk891/article/details/8776479 in c\c++, the file operations are implemented by the library function, mainly divided into two types of read and write operations, the
reprinted from: http://blog.csdn.net/xidianzhimeng/article/details/235412891 fopenFunction prototype: File * fopen (const char * path,const char * mode); return value: When the file is opened successfully, the pointer to the stream will be returned.
fseek function:
int fseek (FILE * _file, long _offset, int _origin);
function to set the location of the file pointer stream. If the execution succeeds, the stream points to the position of Fromwhere as the offset (pointer offset)
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
fopen (Open file)
Defining functions
FILE * fopen(const char * path,const char * mode);
Function description
Parameter The path string contains the file path and filename to open, and the parameter mode
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 (Open file)Correlation function Open,fclose
Table header file #include
Defines the function FILE * fopen (const char * path,const char * mode);
The function description parameter path string contains the file path and filename to open, and
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.