stdlib.h — Standard library functions

The stdlib.h header file contains declarations for the following functions:

_UNIX03_SOURCE

[1]  Built-in function.

[2]  Not supported under C++ applications.

[3]  Special Behavior for C++: For C++ applications, the functions abs() and div() are also overloaded for the type long.

[4]  The __STDC_WANT_DEC_FP__ feature test macro is required to expose decimal floating-point functionality.

Two type definitions are added to stdlib.h for the Compare and Swap functions cs() and cds(). The structures defined are __cs_t and __cds_t.

The type size_t is declared in the header file. It is used for the type of the value returned by sizeof. The type wchar_t is declared and used for a wide character constant. For more information on the types size_t and wchar_t, see stddef.h — typedef statements.

The stdlib.h declares div_t and ldiv_t, which define the structure types that are returned by div() and ldiv().

The stdlib.h file also contains definitions for the following macros:
NULL
The NULL pointer constant (also defined in stddef.h).
EXIT_SUCCESS
Used by the atexit() function.
EXIT_FAILURE
Used by the atexit() function.
RAND_MAX
Expands to an integer representing the largest number that the RAND function can return.
MB_CUR_MAX
Expands to an integer representing the maximum number of bytes in a multibyte character. This value is dependent on the current locale.

If MB_CUR_MAX is set to 1, multibyte functions will behave as if all multibyte characters are one byte long; wide-character functions are not supported and full DBCS support is not provided. If MB_CUR_MAX is 4, all DBCS support provided by the library is enabled.