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/C++ v10.0 : C library - <b>synopsis:</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
Synopsis:
    #include <stdio.h>
    int getc( FILE *fp );

Description:
    The getc function gets the next character from the file designated by
    fp.  The character is returned as an int value.  The getc function is
    equivalent to  fgetc, except that it may be implemented as a macro.

Returns:
    The getc function returns the next character from the input stream
    pointed to by fp.  If the stream is at end-of-file, the end-of-file
    indicator is set and getc returns  EOF.  If a read error occurs, the
    error indicator is set and getc returns  EOF.  When an error has
    occurred,  errno contains a value indicating the type of error that has
    been detected.

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

Example:
    #include <stdio.h>

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

        fp = fopen( "file", "r" );
        if( fp != NULL ) {
          while( (c = getc( fp )) != EOF )
            putchar(c);
          fclose( fp );
        }
      }

Classification:
    ANSI

Systems:
    All

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