Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Watcom C Library Reference - <u>synopsis:</u> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
Synopsis:
    #include <stdio.h>
    int fgetchar( void );
    int _fgetchar( void );
    wint_t _fgetwchar( void );

Description:
    The fgetchar function is equivalent to  fgetc with the argument  stdin.

    The _fgetchar function is identical to fgetchar.  Use _fgetchar for ANSI
    naming conventions.

    The _fgetwchar function is identical to fgetchar except that it gets the
    next multibyte character (if present) from the input stream pointed to
    by  stdin and converts it to a wide character.

Returns:
    The fgetchar 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 is set and fgetchar returns  EOF.  If a read error occurs, the
    error indicator is set and fgetchar returns  EOF.

    The _fgetwchar function returns the next wide character from the input
    stream pointed to by  stdin.  If the stream is at end-of-file, the
    end-of-file indicator is set and fgetchar returns  WEOF.  If a read
    error occurs, the error indicator is set and fgetchar returns  WEOF.  If
    an encoding error occurs,  errno is set to  EILSEQ and fgetchar returns
    WEOF.

    When an error has occurred,  errno contains a value indicating the type
    of error that has been detected.

Example:
    #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:
     fgetchar - All, Netware

    _fgetchar - All, Netware
    _fgetwchar - All

See Also:
    fgetc, fgets, fopen, getc, getchar, gets, ungetc

See Also:

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson