Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ getchar(3S) — bsd — mips UMIPS RISC/os 5.01

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

fopen(3S)

fread(3S)

putc(3S)

gets(3S)

scanf(3S)

ungetc(3S)



GETC(3S-BSD)        RISC/os Reference Manual         GETC(3S-BSD)



NAME
     getc, getchar, fgetc, getw - get character or word from
          stream

SYNOPSIS
     #include <stdio.h>

     int getc(stream)
     FILE *stream;

     int getchar()

     int fgetc(stream)
     FILE *stream;

     int getw(stream)
     FILE *stream;

DESCRIPTION
     getc returns the next character from the named input stream.

     getchar() is identical to getc(stdin).

     fgetc behaves like getc, but is a genuine function, not a
     macro; it may be used to save object text.

     getw returns the next int from the named input stream.  It
     returns the constant EOF upon end of file or error, but
     since that is a good integer value, feof and ferror(3S)
     should be used to check the success of getw.  getw assumes
     no special alignment in the file.

SEE ALSO
     fopen(3S), fread(3S), putc(3S), gets(3S), scanf(3S),
     ungetc(3S).

DIAGNOSTICS
     These functions return the integer constant EOF at end of
     file, upon read error, or if an attempt is made to read a
     file not opened by fopen.  The end-of-file condition is
     remembered, even on a terminal, and all subsequent attempts
     to read will return EOF until the condition is cleared.

ERRORS
     Because it is implemented as a macro, getc treats a stream
     argument with side effects incorrectly.  In particular,
     `getc(*f++);' doesn't work sensibly.








                        Printed 11/19/92                   Page 1



Typewritten Software • bear@typewritten.org • Edmonds, WA 98026