C stdio.h Library Function

C stdio.h Library Function: The <stdio.h> can be defined as “Standard input-output header file“. And the stdio.h header defines three variable types, several macros, and various functions for performing input and output.

Library Variables

Variable Description
size_t This is the unsigned integral type and is the result of the size of the keyword.
FILE It is an object type suitable for storing information for a file stream
fpos_t It is an object type suitable for storing any position in a file

C stdio.h Library Function

List of C Inbuilt Functions in stdio.h file.



Function Description
printf( ) It is used to print the character, string, float, integer, octal and hexadecimal values onto the output screen
scanf( ) It is used to read a character, string, numeric data from the keyboard
getc( ) reads character from a file
gets( ) reads line from the keyboard
getchar( ) reads character from the keyboard
puts( ) writes a line to o/p screen
putchar() writes a character to the screen
clearerr() function clears the error indicators
f open() All file handling functions are defined in stdio.h header file
f close() closes an opened file
getw() reads an integer from a file
putw() writes an integer to file
f getc() reads a character from a file
putc() writes a character to file
f putc() writes a character to file
f gets() reads a string from a file, one line at a time
f puts() writes a string to a file
f eof() finds the end of file
f getchar reads a character from the keyboard
f getc() reads a character from the file
f printf() writes formatted data to a file
f scanf() reads formatted data from a file
f getchar reads a character from the keyboard
f putchar writes a character from the keyboard
f seek() moves file pointer position to a given location
SEEK_SET moves file pointer position to the beginning of the file
SEEK_CUR moves file pointer position to a given location
SEEK_END moves file pointer position to the end of file
f tell() gives the current position of file pointer
rewind() moves file pointer position to the beginning of the file
putc() writes a character to file
sprint() writes formatted output to the string
sscanf() Reads formatted input from a string
remove() deletes a file
fflush() flushes a file

Example

#include<stdio.h> 
void fun(int x) 
{ 
   x = 30; 
}
int main(void) 
{ 
    int x = 20; 
    fun(x); 
    printf("x = %d", x); 
    return 0; 
}

Output
x = 20