/*========================================================== ==========================================Name: quanhaunchong. cAuthor:Version:Copyright: Your copyright noticeDescription: Hello world in C, ANSI-style=====================================
In reading the code, encountered a very early use of the fseek (), a long time no use, a little strange, write for the next review.function function is to point the file pointer to the beginning of the file, need to include the header file
This article mainly introduces the PHP mobile file pointer ftell (), fseek (), rewind () function summary. This article first explains their functions, and then provides specific examples, for more information about how to read and write a file, you
When I was reading the code, I encountered the fseek () that I used very early. It was not practical for a long time. It was a little strange. I wrote it for future reference.
The function is to point the file pointer to the beginning of the file
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
In the process of reading and writing files, it is sometimes necessary to jump in a file, read in different locations, and write data to a different location. For example, you would need to move a file pointer to save data using a file emulation
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.
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
Format: int fgetc (File * stream );
Indicates reading a character from the object pointed to by the file pointer stream.
The return value of this function is a byte read.. If EOF is returned at the end of the file.
The prototype is char *
This article mainly summarizes the file pointer locating problem of fread fwite.
Fread
Function: read data from a stream
Function prototype:Size_t fread (void *Buffer, Size_tSize, Size_tCount, File *Stream);
Parameters:
1. Address (pointer) used to
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.