- Stdio.h
stdio.h, which stands for "standard input/output header", is the header in the C standard library that contains macro definitions, constants, and declarations of functions and types used for various standard
input andoutput operations. The functionality descends from a "portable I/O package" written byMike Lesk at Bell Labs in the early 1970s. [cite book|last=Kernighan|first=Brian|authorlink=Brian Kernighan|coauthors=Rob Pike |title=The UNIX Programming Environment |publisher=Prentice Hall |location=Englewood Cliffs |date=1984|pages=pg. 200]C++ , for compatibility reasons, includesstdio.h
as well as an essentially equivalent header, cstdio.Functions declared in
stdio.h
are extremely popular, since as a part of theC 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 thestdio.h
routines.Example usage
All functions in C (and its many derivatives) are declared in
header file s. Thus, programmers have to include thestdio.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.Member functions
Functions declared in
stdio.h
can generally be divided into two categories: the functions for file manipulation and the functions for input-output manipulation.Member types
Data types defined in the
stdio.h
header include:
*FILE
- a structure containing the information about a file or text stream needed to perform input or output operations on it, including:
** afile descriptor
** the current stream position
** an end-of-file indicator
** an error indicator
** a pointer to the stream's buffer, if applicable
*fpos_t
- a non-array type capable of uniquely identifying the position of every byte in a file.
*size_t
- an unsignedinteger type which is the type of the result of the
operator.sizeof ee also
*
Large file support References
Wikimedia Foundation. 2010.