1:fprintf ()#include int fprintf (FILE *stream, const char *format, ...);The fprintf () function sends information (parameters) according to the specified format (format) to the file specified by the stream (stream). Therefore fprintf () enables the
In addition to manual analysis, the simplest and most direct debugging method is printf. However, the int printf (const char * format,...) function is not recommended for beginners in C language ,...), it is a slightly more complex fprintf ()
1. Relationship between printf and fprintf 1 printf ()# Include Int printf (const char * format ,...);The printf () function prints the output to stdout (standard output) and other parameters according to the format given by format. For the output
Fscanf, fprintf, fgets, fputs, fread, and fwrite functions, fscanffputs1. fscanf function and fprintf function 1.1 fscanf Function
The fscanf function can only be input in the format of a text file. The fscanf function is similar to the scanf
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
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.
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
// Crt_fprintf.c/* This program uses fprintf to format various* Data and print it to the file named fprintf. Out. it* Then displays fprintf. Out on the screen using the System* Function to invoke the operating-system type command.*/
# Include #
Many times we need to write data to the file when it is very disturbing, because the format of seven or eight slots, the readability is too poor,So we think that there is no function can be formatted from the file input and output, there is really.
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 *
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.