The <stdio.h> include file defines constants, macros, and types, and declares stream input and output functions. The stream I/O functions are:
| clearerr | fprintf | fwrite | remove | tmpnam |
| fclose | fputc | getc | rename | ungetc |
| feof | fputs | getchar | rewind | vfprintf |
| ferror | fread | gets | scanf | vprintf |
| fflush | freopen | perror | setbuf | vsprintf |
| fgetc | fscanf | printf | setvbuf | |
| fgetpos | fseek | putc | sprintf | |
| fgets | fsetpos | putchar | sscanf | |
| fopen | ftell | puts | tmpfile |
In extended mode, <stdio.h> also defines the following extensions:
| _fcloseall | _fgetchar |
| fileno | _flushall |
| _fputchar | _rmtmp |
| _set_crt_msg_handle | tempnam |
| unlink |
<stdio.h> also defines the macros listed below. You can use these constants in your programs, but you should not alter their values.
| BUFSIZ | Specifies the buffer size to be used by the setbuf library function when you are allocating buffers for stream I/O. This value establishes the size of system-allocated buffers and is used with setbuf. |
| EOF | The value returned by an I/O function when the end of the file (or in some cases, an error) is found. |
| FOPEN_MAX | The number of files that can be opened simultaneously. |
| FILENAME_MAX | The longest file name supported. If there is no reasonable limit, FILENAME_MAX will be the recommended size. |
| L_tmpnam | The size of the longest temporary name that can be generated by the tmpnam function. |
| P_tmpdir | Indicates the default directory to be used by the tempnam function. |
| TMP_MAX | The minimum number of unique file names that can be generated by the tmpnam function. |
| NULL | A pointer guaranteed not to point to a data object. NULL is also defined in <locale.h>. |
The FILE structure type is defined in <stdio.h>. Stream I/O functions use a pointer to the FILE type to get access to a given stream. The system uses the information in the FILE structure to maintain the stream.
The C standard streams stdin, stdout, and stderr are also defined in <stdio.h>.
The macros SEEK_CUR, SEEK_END, and SEEK_SET expand to integral constant expressions and can be used as the third argument to fseek.
The macros _IOFBF, _IOLBF, and _IONBF expand to integral constant expressions with distinct values suitable for use as the third argument to the setvbuf function.
The type fpos_t is defined in <stdio.h> for use with fgetpos and fsetpos.
![]()
<locale.h>
<stddef.h>
<stdlib.h>
<conio.h>
<io.h>
#include