fgetc(3) Library Functions Manual fgetc(3) fgetc, fgets, getc, getchar, ungetc - LIBRARY Standard C library (libc, -lc) #include int fgetc(FILE *stream); int getc(FILE *stream); int getchar(void); char *fgets(char s[restrict .size], int size, FILE *restrict stream); int ungetc(int c, FILE *stream); fgetc() stream unsigned char int, EOF . getc() fgetc(), , stream . getchar() getc(stdin). fgets() reads in at most one less than size characters from stream and stores them into the buffer pointed to by s. Reading stops after an EOF or a newline. If a newline is read, it is stored into the buffer. A terminating null byte ('\0') is stored after the last character in the buffer. ungetc() c stream, unsigned char, . ; . , , stdio . , . unlocked_stdio(3). fgetc(), getc(), and getchar() return the character read as an unsigned char cast to an int or EOF on end of file or error. fgets() s NULL , . ungetc() c EOF . attributes(7). +----------------------------+----------------------------------------------------------+--------------------------+ | | | | +----------------------------+----------------------------------------------------------+--------------------------+ |fgetc(), fgets(), getc(), | | MT-Safe | |getchar(), ungetc() | | | +----------------------------+----------------------------------------------------------+--------------------------+ C11, POSIX.1-2008. POSIX.1-2001, C89. stdio read(2) , ; , , , . . read(2), write(2), ferror(3), fgetwc(3), fgetws(3), fopen(3), fread(3), fseek(3), getline(3), gets(3), getwchar(3), puts(3), scanf(3), ungetwc(3), unlocked_stdio(3), feature_test_macros(7) Azamat Hackimov , Dmitry Bolkhovskikh , Yuri Kozlov ; GNU 3 , . . , , . Linux man-pages 6.06 31 2023 . fgetc(3)