| 1 |
.\" Copyright, the authors of the Linux man-pages project |
| 2 |
.\" |
| 3 |
.\" SPDX-License-Identifier: Linux-man-pages-copyleft |
| 4 |
.\" |
| 5 |
.TH getc 3 2025-10-10 "Linux man-pages 6.18" |
| 6 |
.SH NAME |
| 7 |
getc \- get character from stream |
| 8 |
.SH LIBRARY |
| 9 |
Standard C library |
| 10 |
.RI ( libc ,\~ \-lc ) |
| 11 |
.SH SYNOPSIS |
| 12 |
.nf |
| 13 |
.B #include <stdio.h> |
| 14 |
.P |
| 15 |
.BI "int getc(FILE *" stream ); |
| 16 |
.fi |
| 17 |
.SH DESCRIPTION |
| 18 |
.BR getc () |
| 19 |
is equivalent to |
| 20 |
.BR fgetc (3), |
| 21 |
except for the BUGS |
| 22 |
(see below). |
| 23 |
.P |
| 24 |
Use |
| 25 |
.BR fgetc (3) |
| 26 |
instead. |
| 27 |
.SH STANDARDS |
| 28 |
C23, POSIX.1-2024. |
| 29 |
.SH HISTORY |
| 30 |
POSIX.1-2001, C89. |
| 31 |
.SH BUGS |
| 32 |
.SS Multiple evaluation |
| 33 |
It may be implemented as a macro, |
| 34 |
and it may evaluate |
| 35 |
.I stream |
| 36 |
more than once. |
| 37 |
.SS Name |
| 38 |
The name is inconsistent. |
| 39 |
It is often confused with |
| 40 |
.BR getchar (3), |
| 41 |
as normally |
| 42 |
.I <stdio.h> |
| 43 |
functions without the "f" prefix in their name |
| 44 |
are variants that use |
| 45 |
.IR stdin . |
| 46 |
.SH SEE ALSO |
| 47 |
.BR fgetc (3) |