Formatted Input/Output
Function | Header File | Page | Description |
---|---|---|---|
fprintf() | stdio.h |
"fprintf() -- Write Formatted Data to a Stream"
| Formats and prints characters to the output stream. |
fscanf() | stdio.h | "fscanf() -- Read Formatted Data" | Reads data from a stream into locations given by arguments. |
fwprintf() |
stdio.h | "fwprintf() -- Format Data as Wide Characters and Write to a Stream" | Formats data as wide characters, and writes to a stream. |
fwscanf() |
stdio.h | "fwscanf() -- Read Data from Stream Using Wide Character" | Reads wide data from stream into locations given by arguments. |
printf() | stdio.h | "printf() -- Print Formatted Characters" | Formats and prints characters to stdout. |
scanf() | stdio.h | "scanf() -- Read Data" | Reads data from stdin into locations given by arguments. |
snprintf() | stdio.h | "snprintf() -- Print Formatted Data to Buffer" | Same as sprintf, except that the snprintf() function will stop after n characters have been written to a buffer. |
sprintf() | stdio.h | "sprintf() -- Print Formatted Data to Buffer" | Formats and writes characters to a buffer. |
sscanf() | stdio.h | "sscanf() -- Read Data" | Reads data from a buffer into locations given by arguments. |
swprintf() | wchar.h | "swprintf() -- Format and Write Wide Characters to Buffer" | Formats and writes wide characters to buffer. |
swscanf() | wchar.h | "swscanf() -- Read Wide Character Data" | Reads wide data from a buffer into locations given by arguments. |
vfprintf() |
stdio.h stdarg.h | "vfprintf() -- Print Argument Data to Stream" | Formats and prints characters to the output stream using a variable number of arguments. |
vfscanf() |
stdarg.h stdio.h | "vfscanf() -- Read Formatted Data" | Reads data from a specified stream into locations given by a variable number of arguments. |
vfwprintf() |
stdio.h stdarg.h | "vfwprintf() -- Format Argument Data as Wide Characters and Write to a Stream" | Formats argument data as wide characters and writes to a stream using a variable number of arguments. |
vfwscanf() |
stdarg.h stdio.h | "vfwscanf() -- Read Formatted Wide Character Data" | Reads wide data from a specified stream into locations given by a variable number of arguments. |
vprintf() |
stdarg.h stdio.h | "vprintf() -- Print Argument Data" | Formats and writes characters to stdout using a variable number of arguments. |
vscanf() |
stdarg.h stdio.h | "vscanf() -- Read Formatted Data" | Reads data from stdin into locations given by a variable number of arguments. |
vsnprintf() |
stdio.h stdarg.h | "vsnprintf() -- Print Argument Data to Buffer" | Same as vsprintf, except that the vsnprintf function will stop after n characters have been written to a buffer. |
vsprintf() |
stdarg.h stdio.h | "vsprintf() -- Print Argument Data to Buffer" | Formats and writes characters to a buffer using a variable number of arguments. |
vsscanf() |
stdarg.h stdio.h | "vsscanf() -- Read Formatted Data" | Reads data from a buffer into locations given by a variable number of arguments. |
vswprintf() |
wchar.h stdarg.h | "vswprintf() -- Format and Write Wide Characters to Buffer" | Formats and writes wide characters to buffer using a variable number of arguments. |
vswscanf() |
stdarg.h whar.h | "vscanf() -- Read Formatted Data" | Reads wide data from a buffer into locations given by a variable number of arguments. |
vwprintf() |
wchar.h stdarg.h | "vwprintf() -- Format Argument Data as Wide Characters and Print" | Formats and writes wide characters to stdout using a variable number of arguments. |
vwscanf() |
stdarg.h stdio.h | "vwscanf() -- Read Formatted Wide Character Data" | Reads wide data from stdin into locations given by a variable number of arguments. |
wprintf() | stdio.h | "wprintf() -- Format Data as Wide Characters and Print" | Formats and writes wide characters to stdout |
wscanf() | stdio.h | "wscanf() -- Read Data Using Wide-Character Format String" | Reads wide data from stdin into locations given by arguments. |
Character and String Input/Output
Function | Header File | Page | Description |
---|---|---|---|
fgetc() | stdio.h | "fgetc() -- Read a Character" | Reads a character from a specified input stream. |
fgets() | stdio.h | "fgets() -- Read a String" | Reads a string from a specified input stream. |
fgetwc() | stdio.h | "fgetwc() -- Read Wide Character from Stream" | Reads a wide character from a specified stream. |
fgetws() | stdio.h | "fgetws() -- Read Wide-Character String from Stream" | Reads a wide-character string from a specified stream. |
fputc() | stdio.h | "fputc() -- Write Character" | Prints a character to a specified output stream. |
_fputchar() | stdio.h | "_fputchar - Write Character" | Writes a character to stdout. |
fputs() | stdio.h | "fputs() -- Write String" | Prints a string to a specified output stream. |
fputwc() | stdio.h | "fputwc() -- Write Wide Character" | Writes a wide character to a specified stream. |
fputws() | stdio.h | "fputws() -- Write Wide-Character String" | Writes a wide-character string to a specified stream. |
getc() | stdio.h | "getc() - getchar() -- Read a Character" | Reads a character from a specified input stream. |
getchar() | stdio.h | "getc() - getchar() -- Read a Character" | Reads a character from stdin. |
gets() | stdio.h | "gets() -- Read a Line" | Reads a line from stdin. |
getwc() | stdio.h | "getwc() -- Read Wide Character from Stream" | Reads a wide character from a specified stream. |
getwchar() | stdio.h | "getwchar() -- Get Wide Character from stdin" | Gets a wide character from stdin. |
putc() | stdio.h | "putc() - putchar() -- Write a Character" | Prints a character to a specified output stream. |
putchar() | stdio.h | "putc() - putchar() -- Write a Character" | Prints a character to stdout. |
puts() | stdio.h | "puts() -- Write a String" | Prints a string to stdout. |
putwc() | stdio.h | "putwc() -- Write Wide Character" | Writes a wide character to a specified stream. |
putwchar() | stdio.h | "putwchar() -- Write Wide Character to stdout" | Writes a wide character to stdout. |
ungetc() | stdio.h | "ungetc() -- Push Character onto Input Stream" | Pushes a character back onto a specified input stream. |
ungetwc() | stdio.h | "ungetwc() -- Push Wide Character onto Input Stream" | Pushes a wide character back onto a specified input stream. |
Direct Input/Output
Function | Header File | Page | Description |
---|---|---|---|
fread() | stdio.h | "fread() -- Read Items" | Reads items from a specified input stream. |
fwrite() | stdio.h | "fwrite() -- Write Items" | Writes items to a specified output stream. |
File Positioning
Function | Header File | Page | Description |
---|---|---|---|
fgetpos() | stdio.h | "fgetpos() -- Get File Position" | Gets the current position of the file pointer. |
fseek() | stdio.h | "fseek() -- fseeko() -- Reposition File Position" | Moves the file pointer to a new location. |
fseeko() | stdio.h | "fseek() -- fseeko() -- Reposition File Position" | Same as fseek(). |
fsetpos() | stdio.h | "fsetpos() -- Set File Position" | Moves the file pointer to a new location. |
ftell() | stdio.h | "ftell() -- ftello() -- Get Current Position" | Gets the current position of the file pointer. |
ftello() | stdio.h | "ftell() -- ftello() -- Get Current Position" | Same as ftell(). |
rewind() | stdio.h | "rewind() -- Adjust Current File Position" | Repositions the file pointer to the beginning of the file. |
File Access
Function | Header File | Page | Description |
---|---|---|---|
fclose() | stdio.h | "fclose() -- Close Stream" | Closes a specified stream. |
fdopen() | stdio.h | "fdopen() -- Associates Stream With File Descriptor" | Associates an input or output stream with a file. |
fflush() | stdio.h | "fflush() -- Write Buffer to File" | Causes the system to write the contents of a buffer to a file. |
fopen() | stdio.h | "fopen() -- Open Files" | Opens a specified stream. |
freopen() | stdio.h | "freopen() -- Redirect Open Files" | Closes a file and reassigns a stream. |
fwide() | stdio.h | "fwide() -- Determine Stream Orientation" | Determines stream orientation. |
setbuf() | stdio.h | "setbuf() -- Control Buffering" | Allows control of buffering. |
setvbuf() | stdio.h | "setvbuf() -- Control Buffering" | Controls buffering and buffer size for a specified stream. |
wfopen() | stdio.h | "wfopen() --Open Files" | Opens a specified stream, accepting file name and mode as wide characters. |
File Operations
Function | Header File | Page | Description |
---|---|---|---|
fileno() | stdio.h | "fileno() -- Determine File Handle" | Determines the file handle. |
remove() | stdio.h | "remove() -- Delete File" | Deletes a specified file. |
rename() | stdio.h | "rename() -- Rename File" | Renames a specified file. |
tmpfile() | stdio.h | "tmpfile() -- Create Temporary File" | Creates a temporary file and returns a pointer to that file. |
tmpnam() | stdio.h | "tmpnam() -- Produce Temporary File Name" | Produces a temporary file name. |
(C) Copyright IBM Corporation 1992, 2006. All Rights Reserved.