The stdio.h header file in C is a standard input-output library that provides functions for input and output operations. It stands for “standard input-output header”. This header file declares several functions, including printf
, scanf
, fopen
, fclose
, fread
, fwrite
, etc., as well as various macros and data types.
std
means Standard andio
means Input-output statements- These statements are used to get and put data on computers
- Ex-1: Can put data to a computer via the keyboard.
- Ex-2: Can get data and see that in Monitor.
- Input-output statements are used as a function in c language
stdio.h
file contains that statements statements- So if we use these functions should include
stdio.h
, functions arescanf()
,printf()
,getchar()
,gets()
,putchar()
,puts()
.
Here’s a brief overview of some commonly used functions and macros declared in stdio.h
:
printf
: Used to print formatted output to the standard output (usually the console).scanf
: Used to read formatted input from the standard input (usually the keyboard).fprintf
,fscanf
,sprintf
,sscanf
: Variants ofprintf
andscanf
for performing formatted I/O operations on files or strings.FILE
: Data type representing a file stream used by functions likefopen
,fclose
,fread
,fwrite
, etc.stdin
,stdout
,stderr
: Predefined file streams representing standard input, standard output, and standard error respectively.
Including stdio.h
at the beginning of your C program allows you to use these functions and macros. It’s an essential header file for most C programs, as it provides basic input and output capabilities.