C language fgets (...) Read input from stream, opposite fputs (...) Writes data to a file.
for ANSI C programs, the runtime system opens at least three streams, including the following 3 streams:
1. Standard input standard inputs. The standard
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
Say a fgets (..) Function.Prototype char * fgets (char * s, int n,file *stream);Parameters:S: A character pointer that points to the address of the buffer that stores the read-in data.N: n-1 characters are read from a streamStream: A stream that
The two standard IO fputs and fgets in the C language are read on the line for the data! Here about these two IO functions I have a few small details I would like to share with you here, I hope to be able to help you!First, the function declarations
How to Use fputs () fgets () in C language, fputsfgets1. The fgets function of the string reading function reads a string from a specified file to a character array. The function is called in the form of fgets (character array name, n, file pointer);
String read/write functions fgets and fputs
1. The fgets function of the string reading function reads a string from a specified file to a character array. The function is called in the form of fgets (character array name, n, file pointer );N is a
Summary of Functions Fgets and fputs, Fread and Fwrite, fscanf, and fprintf usagestring read and Write functions fgets and fputsThe function of reading a string function Fgets function is to read a string into a character array from the specified
String read/write functions fgets and fputs 1. The function of reading string functions fgets is to read a string from a specified file to a character array. The function is called in the form: fgets (character array name, N, file pointer); where N
Http://hi.baidu.com/dujt/blog/item/f6e6704ab5d8932508f7ef2c.html
In ansi c, file operations are divided into two methods: stream file operations and I/O file operations, which are described below.
I. Stream File OperationsThis file operation has an
C language Fputc () function: Write file function (writes a specified character to the file stream)
Header file:
#include
To define a function:
int FPUTC (int c, FILE * stream);
Function Description: FPUTC will convert parameter
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.