C++ Standard Library headers
The interface of C++ standard library is defined by the following collection of headers.
C compatibility headers
For some of the C standard library headers of the form xxx.h
, the C++ standard library both includes an identically-named header and another header of the form cxxx
(all meaningful cxxx
headers are listed above). The intended use of headers of form
xxx
With the exception of complex.h
, each xxx.h
header included in the C++ standard library places in the global namespace each name that the corresponding cxxx
header would have placed in the std
These headers are allowed to also declare the same names in the std namespace, and the corresponding cxxx
headers are allowed to also declare the same names in the global namespace: including <cstdlib> definitely provides std::malloc and may also provide ::malloc. Including <stdlib.h> definitely provides ::malloc and may also provide std::malloc
Notes: xxx.h
headers are deprecated in C++98 and undeprecated in C++23. These headers are discouraged for pure C++ code, but not subject to future removal.
Behaves same as <cassert> | |
Behaves as if each name from <cctype> is placed in global namespace | |
Behaves same as <cerrno> | |
(C++11)
|
Behaves as if each name from <cfenv> is placed in global namespace |
Behaves same as <cfloat> | |
(C++11)
|
Behaves as if each name from <cinttypes> is placed in global namespace |
Behaves same as <climits> | |
Behaves as if each name from <clocale> is placed in global namespace | |
Behaves as if each name from <cmath> is placed in global namespace, except for names of mathematical special functions |
|
Behaves as if each name from <csetjmp> is placed in global namespace | |
Behaves as if each name from <csignal> is placed in global namespace | |
Behaves as if each name from <cstdarg> is placed in global namespace | |
Behaves as if each name from <cstddef> is placed in global namespace, except for names of std::byte and related functions
|
|
(C++11)
|
Behaves as if each name from <cstdint> is placed in global namespace |
Behaves as if each name from <cstdio> is placed in global namespace | |
Behaves as if each name from <cstdlib> is placed in global namespace | |
Behaves as if each name from <cstring> is placed in global namespace | |
Behaves as if each name from <ctime> is placed in global namespace | |
(C++11)
|
Behaves as if each name from <cuchar> is placed in global namespace |
Behaves as if each name from <cwchar> is placed in global namespace | |
Behaves as if each name from <cwctype> is placed in global namespace |
Special C compatibility headers
The header <stdatomic.h> declares names which are also provided in the C standard library, and defines the _Atomic
macro which is a keyword in C. Unlike other xxx.h
headers, corresponding <cstdatomic>
(C++23)
|
Defines _Atomic and provides corresponding components in the C standard library |
Empty C headers
The headers <complex.h>, <ccomplex>, <tgmath.h>, and <ctgmath>
(C++11)
(deprecated in C++17)
(removed in C++20)
|
Simply includes the header <complex> |
(C++11)
|
Simply includes the header <complex> |
(C++11)
(deprecated in C++17)
(removed in C++20)
|
Simply includes the headers <complex> and <cmath>: the overloads equivalent to the contents of the C header tgmath.h
|
(C++11)
|
Simply includes the headers <complex> and <cmath> |
Meaningless C headers
The headers <ciso646>, <cstdalign>, and <cstdbool>
(removed in C++20)
|
Empty header. The macros that appear in iso646.h in C are keywords in C++
|
(C++11)
(deprecated in C++17)
(removed in C++20)
|
Defines one compatibility macro constant |
(C++11)
(deprecated in C++17)
(removed in C++20)
|
Defines one compatibility macro constant |
Has no effect | |
(C++11)
|
Defines one compatibility macro constant |
(C++11)
|
Defines one compatibility macro constant |
Unsupported C headers
The C headers <stdatomic.h>,(until C++23)
<stdnoreturn.h>, and <threads.h> are not included in C++ and have no cxxx
Experimental libraries
C++ TR's/TS's also define several collections of headers.
See also
C documentation for C Standard Library headers
|