#include <stdio.h>
int
fgetc
(FILE *stream );
The fgetc function obtains the next character (if present) as an unsigned char converted to an int, from the input stream pointed to by stream, and advances the associated file position indicator for the stream (if defined).
The fgetc function returns the next character from the input stream pointed to by stream. If the stream is at end-of-file, the end-of-file indicator for the stream is set and fgetc returns EOF. If a read error occurs, the error indicator for the stream is set and fgetc returns EOF.
The value of stream must be stdin.
#include <stdio.h>
int
fgets
(char *s,
int n, FILE *stream);
The fgets function reads at most one less than the number of characters specified by n from the stream pointed to by stream into the array pointed to by s. No additional characters are read after a new-line character (which is retained) or after end-of-file. A null character is written immediately after the last character read into the array.
The fgets function returns s if successful. If end-of-file is encountered and no characters have been read into the array, the contents of the array remain unchanged and a null pointer is returned. If a read error occurs during the operation, the array contents are indeterminate and a null pointer is returned.
The value of stream must be stdin.
#include <stdio.h>
int
fputc
(int c ,
FILE *stream );
The fputc function is supported as specified in ANSI C 7.9.7.3.
The fputc function returns the character written. If a write error occurs the error indicator is set and fputc returns EOF.
The value of stream must be stdout or stderr.
#include <stdio.h>
int
fputs
(const char *s, FILE *stream);
The fputs function writes the string pointed to by s to the stream pointed to by stream. The terminating null character is not written.
The fputs function returns EOF if a write error occurs: otherwise it returns a non-negative value.
The value of stream must be stdout or stderr.
#include <stdio.h>
int
getc
(FILE *stream
);
The getc function is equivalent to fgetc, except that if it is implemented as a macro, it may evaluate stream more than once, so the argument should never be an expression with side effects.
The getc function returns the next character from the input stream pointed to by stream. If the stream is at end-of-file, the end-of-file indicator for the stream is set and fgetc returns EOF. If a read error occurs, the error indicator for the stream is set and getc returns EOF.
The getc function
#include <stdio.h>
int
getchar
(void );
The getchar function is equivalent to getc with the argument stdin.
The getchar function returns the next character from the input stream pointed to by stdin. If the stream is at end-of-file, the end-of-file indicator for the stream is set and getchar returns EOF. If a read error occurs, the error indicator for the stream is set and getchar returns EOF.
The getchar function
#include <stdio.h>
int
gets
(char *s
);
The gets function reads character from the input stream pointed to by stdin, into the array pointed to by s, until an end-of-file is encountered or a new-line character is read. any new-line character is discarded and a null character is written immediately after the last character read into the array.
The gets function returns s if successful. If end-of-file is encountered and no characters have been read into the array, the contents of the array remain unchanged and a null pointer is returned. If a read error occurs during the operation, the array contents are indeterminate and a null pointer is returned.
The gets function
#include <stdio.h>
int
putc
(int c , FILE
*stream );
The putc function is supported as specified in ANSI C 7.9.7.8.
The putc function returns the character written. If a write error occurs, the error indicator for the stream is set and putc returns EOF.
The value of stream must be stdout or stderr.
#include <stdio.h>
int
putchar
(intc
);
The putchar function is supported as specified in ANSI C 7.9.7.9.
The putchar function returns the character written. If a write error occurs, the error indicator for the stream is set and putchar returns EOF.
#include <stdio.h>
int
puts
(const char *s );
The puts function writes the string pointed to by s to the stream pointed to by stdout and appends a new-line character to the output. The terminating null character is not written.
The puts function returns EOF if a write error occurs: otherwise it returns a non-negative value.