#include <stdio.h>
#define MAXLINE 20
int main (void)
{
Char Line[maxline];
while (Fgets (Line,maxline,stdin)!=null && line[0]! = ' \ n ')
Fputs (line,stdout);
return 0;
}
The fgets () function is the address (char * type) used to store the input. The second argument is an integral type, which represents the maximum length of the input string. The last parameter is the file pointer, which points to the file to be read
Fgets (BUF,MAX,FP)
The fputs () function accepts two parameters, which in turn are the address of a string and a pointer to a file. It writes a string known as a string address pointer to the specified file . Unlike the puts () function, the fputs () function does not add a newline character when printed.
Fputs (BUF,FP);
Here buf is the address of the string, FP specifies the destination file
The difference between the Fgets function and the fputs function