c:io:start

C++ Reference

Standard C I/O

These functions provide an alternative to the C++ stream-based IO classes.

clearerrclears errors
fcloseclose a file
feoftrue if at the end-of-file
ferrorchecks for a file error
fflushwrites the contents of the output buffer
fgetcget a character from a stream
fgetposget the file position indicator
fgetsget a string of characters from a stream
fopenopen a file
fprintfprint formatted output to a file
fputcwrite a character to a file
fputswrite a string to a file
freadread from a file
freopenopen an existing stream with a different name
fscanfread formatted input from a file
fseekmove to a specific location in a file
fsetposmove to a specific location in a file
ftellreturns the current file position indicator
fwritewrite to a file
getcread a character from a file
getcharread a character from stdin
getsread a string from stdin
perrordisplays a string version of the current error to stderr
printfwrite formatted output to stdout
putcwrite a character to a stream
putcharwrite a character to stdout
putswrite a string to stdout
removeerase a file
renamerename a file
rewindmove the file position indicator to the beginning of a file
scanfread formatted input from stdin
setbufset the buffer for a specific stream
setvbufset the buffer and size for a specific stream
snprintfwrite formated output to a buffer (with bound checking)
sprintfwrite formatted output to a buffer
sscanfread formatted input from a buffer
tmpfilereturn a pointer to a temporary file
tmpnamreturn a unique filename
ungetcputs a character back into a stream
vprintf, vfprintf, and vsprintfwrite formatted output with variable argument lists
vscanf, vfscanf, and vsscanfgets formatted input from stdin with variable argument lists