1GETC(3S)                                                              GETC(3S)
2
3
4

NAME

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

SYNOPSIS

9       #include <stdio.h>
10
11       int getc(stream)
12       FILE *stream;
13
14       int getchar()
15
16       int fgetc(stream)
17       FILE *stream;
18
19       int getw(stream)
20       FILE *stream;
21

DESCRIPTION

23       Getc returns the next character from the named input stream.
24
25       Getchar() is identical to getc(stdin).
26
27       Fgetc behaves like getc, but is a genuine function, not a macro; it may
28       be used to save object text.
29
30       Getw returns the next int (a 32-bit integer on a VAX-11) from the named
31       input  stream.   It returns the constant EOF upon end of file or error,
32       but since that is a good integer value, feof and ferror(3S)  should  be
33       used  to  check the success of getw.  Getw assumes no special alignment
34       in the file.
35

SEE ALSO

37       clearerr(3S),  fopen(3S),  putc(3S),  gets(3S),  scanf(3S),  fread(3S),
38       ungetc(3S)
39

DIAGNOSTICS

41       These  functions  return  the integer constant EOF at end of file, upon
42       read error, or if an attempt is made to  read  a  file  not  opened  by
43       fopen.   The  end-of-file  condition is remembered, even on a terminal,
44       and all subsequent attempts to read will return EOF until the condition
45       is cleared with clearerr(3S).
46

BUGS

48       Because  it  is  implemented  as a macro, getc treats a stream argument
49       with side effects incorrectly.  In  particular,  `getc(*f++);'  doesn't
50       work sensibly.
51
52
53
547th Edition                      May 14, 1986                         GETC(3S)
Impressum