This library uses what are called streams to operate with physical devices such as keyboards, printers, terminals or with any other type of files supported by the system. Streams are an abstraction to interact with these in a uniform way. All streams have similar properties independent of the individual characteristics of the physical media they are associated with.
Functions Most of the C file input/output functions are defined in (or in the
C++ header , which contains the standard C functionality but in the
namespace).
Constants Constants defined in the header include:
Variables Variables defined in the header include:
Member types Data types defined in the header include: • – also known as a
file handle or a '''''', this is an
opaque pointer containing the information about a file or text stream needed to perform input or output operations on it, including: • platform-specific identifier of the associated I/O device, such as a
file descriptor • the buffer • stream orientation indicator (unset, narrow, or wide) • stream buffering state indicator (unbuffered, line buffered, fully buffered) • I/O mode indicator (input stream, output stream, or update stream) • binary/text mode indicator • end-of-file indicator • error indicator • the current stream position and multibyte conversion state (an object of type ) • reentrant lock (required as of
C11) • – a non-array type capable of uniquely identifying the position of every byte in a file and every conversion state that can occur in all supported multibyte character encodings • – an
unsigned integer type which is the type of the result of the operator.
Extensions The
POSIX standard defines several extensions to in its Base Definitions, among which are a function that allocates memory, the and functions that establish the link between objects and
file descriptors, and a group of functions for creating objects that refer to in-memory buffers. ==Example==