The <stdio.h> header provides functions for performing input and output.
The <stdio.h> header shall define the following macro constant:
The <stdio.h> header shall define the following functions:
Operations on files:
File access:
Formatted input/output:
Character input/output:
Direct input/output:
File positioning:
Error-handling:
The <stdio.h> header shall define the following type:
Related topics:
<setdef.h> | <stdint.h> | <stdlib.h> | <stdnoreturn.h> | <string.h> | Standard Library in C
List of topics: C Programming
The <stdio.h> header shall define the following macro constant:
EOF | A negative integer of type int used to indicate end-of-file conditions |
BUFSIZ | An integer which is the size of the buffer used by the setbuf() function |
FILENAME_MAX | The size of a char array which is large enough to store the name of any file that can be opened |
FOPEN_MAX | The number of files that may be open simultaneously; will be at least eight |
_IOFBF | An abbreviation for "input/output fully buffered"; it is an integer which may be passed to the setvbuf() function to request block buffered input and output for an open stream |
_IOLBF | An abbreviation for "input/output line buffered"; it is an integer which may be passed to the setvbuf() function to request line buffered input and output for an open stream |
_IONBF | An abbreviation for "input/output not buffered"; it is an integer which may be passed to the setvbuf() function to request unbuffered input and output for an open stream |
stdin | expression of type FILE* associated with the input stream |
stdout | expression of type FILE* associated with the output stream |
stderr | expression of type FILE* associated with the error output stream |
NULL | A macro expanding to the null pointer constant; that is, a constant representing a pointer value which is guaranteed not to be a valid address of an object in memory |
SEEK_CUR | An integer which may be passed to the fseek() function to request positioning relative to the current file position |
SEEK_END | An integer which may be passed to the fseek() function to request positioning relative to the end of the file |
SEEK_SET | An integer which may be passed to the fseek() function to request positioning relative to the beginning of the file |
TMP_MAX | The maximum number of unique filenames generable by the tmpnam() function; will be at least 25 |
TMP_MAX_S | maximum number of unique filenames that can be generated by tmpnam_s(C11) |
L_tmpnam | The size of a char array which is large enough to store a temporary filename generated by the tmpnam() function |
L_tmpnam_s | size needed for an array of char to hold the result of tmpnam_s |
The <stdio.h> header shall define the following functions:
Operations on files:
remove | erases a file |
rename | renames a file |
tmpfile tmpfile_s | returns a pointer to a temporary file (C11) |
tmpnam tmpnam_s | returns a unique filename (C11) |
File access:
fopen fopen_s(C11) | opens a file |
freopen freopen_s(C11) | open an existing stream with a different name |
fclose | closes a file |
fflush | synchronizes an output stream with the actual file |
setbuf | sets the buffer for a file stream |
setvbuf | sets the buffer and its size for a file stream |
Formatted input/output:
scanf fscanf sscanf scanf_s(C11) fscanf_s(C11) sscanf_s(C11) | reads formatted input from stdin, a file stream or a buffer |
vscanf(C99) vfscanf(C99) vsscanf(C99) vscanf_s(C11) vfscanf_s(C11) vsscanf_s(C11) | reads formatted input from stdin, a file stream or a buffer using variable argument list |
printf fprintf sprint snprintf(C99) printf_s(C11) fprintf_s(C11) sprintf_s(C11) snprintf_s(C11) | prints formatted output to stdout, a file stream or a buffer |
vprintf vfprintf vsprintf vsnprintf(C99) vprintf_s(C11) vfprintf_s(C11) vsprintf_s(C11) vsnprintf_s(C11) | prints formatted output to stdout, a file stream or a buffer using variable argument list |
Character input/output:
fgetc getc | gets a character from a file stream |
fgets | gets a character string from a file stream |
fputc putc | writes a character to a file stream |
fputs | writes a character string to a file stream |
getchar | reads a character from stdin |
gets gets_s(C11) | reads a character string from stdin |
putchar | writes a character to stdout |
puts | writes a character string to stdout |
ungetc | puts a character back into a file stream |
Direct input/output:
fread | reads from a file |
fwrite | writes to a file |
File positioning:
ftell | returns the current file position indicator |
fgetpos | gets the file position indicator |
fseek | moves the file position indicator to a specific location in a file |
fsetpos | moves the file position indicator to a specific location in a file |
rewind | moves the file position indicator to the beginning in a file |
Error-handling:
clearerr | clears errors |
feof | checks for the end-of-file |
ferror | checks for a file error |
perror | displays a character string corresponding of the current error to stderr |
The <stdio.h> header shall define the following type:
FILE | type, capable of holding all information needed to control a C I/O stream |
fpos_t | type, capable of uniquely specifying a position and mutibyte parser state in a file |
size_t | Unsigned integral type |
Related topics:
<setdef.h> | <stdint.h> | <stdlib.h> | <stdnoreturn.h> | <string.h> | Standard Library in C
List of topics: C Programming
No comments:
Post a Comment