C language Fputc () function: Write file function (writes a specified character to the file stream)
Header file:
To define a function:
int FPUTC (int c, FILE * stream);
Function Description: FPUTC will convert parameter c to unsigned char and write to the file specified by the parameter stream.
return value: FPUTC () returns the character written successfully, that is, parameter C. If EOF is returned, a write failure is represented.
Example
#include <stdio.h>
Main ()
{
FILE * FP;
Char a[26] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
int i;
fp = fopen ("Noexist", "w");
for (i = 0; i < i++)
FPUTC (A[i], FP);
Fclose (FP);
C language Fputs () function: Write file function (write a specified string to a file)
Header file:
To define a function:
int fputs (const char * s, FILE * stream);
Function Description: fputs () is used to write the string that the parameter s refers to in the file referred to by the parameter stream.
Return value: Returns the number of characters written if successful, and the return of EOF indicates an error occurred.