GETC(3S) UNIX Programmer's Manual GETC(3S) NAME getc, getchar, fgetc, getw - get character or word from stream file SYNOPSIS #include int getc (stream) FILE *stream; int getchar () int fgetc (stream) FILE *stream; int getw (stream) FILE *stream; HP-UX COMPATIBILITY Level: HP-UX/RUN ONLY Origin: System V DESCRIPTION _G_e_t_c returns the next character from the named input _s_t_r_e_a_m. _G_e_t_c_h_a_r() is identical to _g_e_t_c(_s_t_d_i_n). _F_g_e_t_c behaves like _g_e_t_c, but is a genuine function, not a macro; it may therefore be used as an argument. _F_g_e_t_c runs more slowly than _g_e_t_c, but takes less space per invocation. _G_e_t_w returns the next word (int) from the named input _s_t_r_e_a_m. It returns the constant EOF upon end of file or error, but since that is a valid integer value, _f_e_o_f and _f_e_r_r_o_r(3S) should be used to check the success of _g_e_t_w. _G_e_t_w assumes no special alignment in the file. SEE ALSO ferror(3S), fopen(3S), fread(3S), gets(3S), putc(3S), scanf(3S). DIAGNOSTICS These functions return the integer constant EOF at end of file or upon read error. BUGS _G_e_t_c and its variant _g_e_t_c_h_a_r return EOF on end of file. Because it is implemented as a macro, _g_e_t_c treats incorrectly a _s_t_r_e_a_m argument with side effects. In partic- ular, getc(*f++); doesn't work sensibly.