fgetchar

get a character from stdin

Synopsis:

#include <stdio.h>
int fgetchar( void );

Description:

The fgetchar() function is equivalent to fgetc() with the argument stdin.

Returns:

See also:

errno, fgetc(), getc(), getchar()

Examples:

#include <stdio.h>

void main()
  {
    FILE *fp;
    int c;

    fp = freopen( "file", "r", stdin );
    if( fp != NULL ) {
      while( (c = fgetchar()) != EOF )
        fputchar(c);
      fclose( fp );
    }
  }

Classification:

WATCOM

Systems:

All (except DOS/PM)