Chapter 27. Standard Library Header Files
The interface to the C++ Standard Library consists of 51 header files, 18 of which present the C standard library. It's often difficult to remember which header files you need to include in your program files, so this material provides a brief description of the contents of each header, organized into seven categories:
The C Standard Library
Containers
Algorithms, iterators, and allocators
Utilities
Exceptions
Numerical processing
I/O Streams
The C Standard Library
The C++ Standard Library includes the entire C Standard Library. The header files are generally the same, except for two points:
The header names are
<cname>
instead of<name.h>
.All the names declared in the header files are in namespace
std
.
For backward compatibility, you can still include
if you want. That puts the names into the global namespace instead of into namespace
<name.h>
We recommend avoiding this feature.
std.
The following table provides a summary of the most useful functionality:
Header File Name | Contents |
---|---|
|
|
| Character predicates and manipulation functions, such as |
<cerrno> | Defines |
<cfloat> | C-style defines related to floating-point arithmetic, such as |
| In C, the |
| C-style limit defines, such as |
| A few localization macros and functions like |
|
Get Professional C++ now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.