cstdlib header

From Cppwiki

(Redirected from cstdlib)
Jump to: navigation, search

The cstdlib #include is part of the C++ Standard Library. It is the C++ version of the C Standard Library stdlib.h include.

It is responsible for making sure the following symbols are declared within the [[std namespace:

Types:

       div_t, ldiv_t

Functions:

       abort, abs, atexit, atof, atoi,
       atol, bsearch, calloc, div, free
       getenv, labs, ldiv, malloc, mblen,
       mbstowcs, mbtowc, qsort, rand, realloc
       srand, stdtol, stdtod, strtoul, system
       wcstombs, wctomb

Note that cstdlib is usually implemented by #including stdlib.h then importing these symbols into the std namespace via using declarations, rather than duplicating the declarations in both headers. This means that the symbols, along with any others stdlib.h declares, will appear in the global namespace in addition to std.

Personal tools