Skip to content
C stdio.h
Functions
- fclose()
- Closes an open file, flushing any unwritten data and releasing the file handle.
- feof()
- Checks if the end-of-file (EOF) has been reached in a file stream, returning a nonzero value if true.
- ferror()
- Checks if an error occurred during a file operation, returning a nonzero value if an error is detected.
- fgetc()
- Reads a single character from a file, returning its ASCII value and advancing the file position indicator.
- fgets()
- Reads a line from a file into a character array, stopping at a newline or reaching the specified limit.
- fopen()
- Opens a file with a specified mode (e.g., read, write, append) and returns a file pointer for further operations.
- fprintf()
- Writes a formatted string into a file, similar to printf but directing output to a file stream.
- fputc()
- Writes a single character to a file, advancing the file position indicator.
- fputs()
- Writes a null-terminated string to a file and advances the file position indicator.
- fread()
- Reads data from a file into a block of memory, typically used for binary file operations.
- fscanf()
- Reads formatted input from a file and stores the values into specified memory locations.
- fseek()
- Moves the file position indicator to a specified location within the file.
- ftell()
- Returns the current position of the file position indicator within an open file.
- fwrite()
- Writes data from a block of memory to a file, commonly used for binary file writing.
- getc()
- Reads a single character from a file, equivalent to
fgetc()
.
- getchar()
- Reads a single character from user input via standard input (stdin) and returns its ASCII value.
- printf()
- Prints a formatted string to the console, allowing text and variable substitution.
- putc()
- Writes a single character to a file, equivalent to
fputc()
.
- putchar()
- Outputs a single character to the console.
- puts()
- Outputs a string to the console followed by a newline character.
- remove()
- Deletes a file from the filesystem.
- rename()
- Changes the name of a file or moves it to a new location.
- rewind()
- Resets the file position indicator to the beginning of the file.
- scanf()
- Reads formatted input from the standard input (stdin) and stores values in specified memory locations.
- snprintf()
- Writes a formatted string into a character array, ensuring that the output does not exceed the specified buffer size (memory-safe).
- sprintf()
- Writes a formatted string into a character array without checking for buffer overflow.
- sscanf()
- Reads formatted data from a string and stores the values in specified memory locations.