stdio.h, which stands for "standard input/output header", is the header in the Cstandard library that contains macro definitions, constants, and declarations of functions and types used for various standard input and output operations. The functionality descends from a "portable I/O package" written by Mike Lesk at Bell Labs in the early 1970s. C++, for compatibility reasons, includes stdio.h as well as an essentially equivalent header, cstdio.
Functions declared in stdio.h are extremely popular, since as a part of the C standard library, they are guaranteed to work on any platform that supports C. Applications on a particular platform might, however, have reasons to use the platform's I/O routines, rather than the stdio.h routines.
All functions in C (and its many derivatives) are declared in header files. Thus, programmers have to include the
stdio.h header in the source code in order to use the functions declared in it.
The above program reads all input from standard input and echoes it to standard output, byte by byte, adding a newline at the end of its output.
Functions declared in stdio.h can generally be divided into two categories: the functions for file manipulation and the functions for input-output manipulation.
reads and returns a character from a given stream and advances the file position indicator; it is allowed to be a macro with the same effects as fgetc, except that it may evaluate the stream more than once
writes and returns a character to a stream and advances the file position indicator for it; it is allowed to be a macro with the same effects as fputc, except that it may evaluate the stream more than once