C Headers

The standard ANSI/ISO C header files for a full, hosted implementation are:

assert.h - internal error detection
complex.h (C99) - support for complex arithmetic and imaginary numbers
ctype.h - character classification and case-mapping macros
errno.h - global error number definitions
fenv.h (C99) - defines the floating point environment
float.h (free) - the maximum and minimum values of floating point types
inttypes.h (C99) - functions for fine grained control over integers
iso646.h (Amd1) (free) - alternative spellings for limited character sets
limits.h (free) - the maximum and minimum values of the basic data types
locale.h - support for localization
math.h - math support (logarithms, trigonomic functions, etc)
setjmp.h - non-local jumps
signal.h - signal handler prototypes and definations
stdarg.h (free) - support for writing variable argument (variadic) functions
stdbool.h (C99) (free) - definitions for bool, true, and false
stddef.h (free) - standard defintions such as NULL and size_t
stdint.h (C99) (free) - type definitions for integers with specific widths (e.g. int32_t)
stdio.h - standard C I/O such as printf and scanf
stdlib.h - miscellaneous C library functions and macros
string.h - the various str* functions
tgmath.h (C99) - type generic math
time.h - system clock, date, and time support
wchar.h (Amd1) - wide character support
wctype.h (Amd1) - wide character classification and case-mapping macros

The headers marked Amd1 were added in the 1995 ammendment to the C standard. Those marked with C99 were added to the C99 standard in 1999.

The C standard also defines a freestanding implementation, which may not implement the whole C library. Freestanding implementations are sometimes seen for embedded platforms where much of the standard library is irrelevent. Only those headers marked free are guaranteed to be present.

All of the standard C headers are valid in C++ as well, except for those introduced in the C99 standard. Presumably, the new C99 headers will be added into the C++ standard some time in the future. In C++, the C headers can be included in one of two ways:
#include <stdio.h> (as in C) or
#include <cstdio> (prefixed with c and without the trailing .h)

There is a subtle difference in how these two methods are treated. In the first case, where the C syntax is used, the symbols are put into the global namespace. With the second, C++ style syntax, the symbols are put into the std namespace.

C++ Headers

The addtional headers defined in C++ are listed here. Note that, unlike C headers, no .h suffix is necessary in C++.

algorithm - standard generic algorithm functions and classes
bitset - standard bitset class
complex - standard complex number classes
deque - standard deque container class
exception - classes and functions for handling exceptions
fstream - file stream iostreams
functional - function objects (classes with operator() defined) for use with STL
iomanip - iostream manipulators for formatting and controlling iostreams
ios - iostream base classes
iosfwd - forward declarations of iostream classes
iostream - standard iostream object classes
istream - input iostreams
iterator - standard iterator classes
limits - maximum and minimum values for the basic numeric types
list - standard list container class
locale - functions and classes for localization
map - standard map and multimap container classes
memory - allocator classes for STL memory management
new - functions and classes for managing dynamic memory allocation with new and delete
numeric - standard numeric algorithm functions and classes
ostream - output iostreams
queue - standard queue and priority_queue container classes
set - standard set and multiset container classes
sstream - string stream iostreams
stack - standard stack container class
stdexcept - standard exceptions for reporting runtime errors
streambuf - iostream stream buffers
string - the standard string class
typeinfo - classes for runtime type information (RTTI)
utility - utility classes used throughout library (e.g. pair class)
valarray - standard numeric array classes used with complex numbers and the numeric algorithms defined in numeric
vector - standard vector container class

Log in or register to write something here or to contact authors.