get the next character from a file
#include <stdio.h> int fgetc( FILE *fp );
The fgetc() function gets the next character from the file designated by fp. The character is signed.
errno, fgetchar(), fgets(), fopen(), getc(), gets(), ungetc()
#include <stdio.h>
void main()
{
FILE *fp;
int c;
fp = fopen( "file", "r" );
if( fp != NULL ) {
while( (c = fgetc( fp )) != EOF )
fputc( c, stdout );
fclose( fp );
}
}
ANSI
All (except DOS/PM)