Chapter 10. General Utilities <stdlib.h>

Table of Contents
10.1. String Conversion Functions
10.2. Pseudo-Random Sequence Generation Functions
10.3. Memory Management Functions
10.4. Communication with the Environment
10.5. Searching and Sorting Utilities
10.6. Integer Arithmetic Functions
10.7. Multi-byte Character Functions
10.8. Multi-byte String Functions

The header <stdlib.h> declares four types and several functions of general utility, and defines several macros.

The types declared are size_t and wchar_t (both described in the ANSI specification refsection 7.1.6),

div_t

which is a structure type that is the type of the value returned by the div function, and

ldiv_t

which is a structure type that is the type of the value returned by the ldiv function.

The macros defined are NULL (described in in the ANSI specification refsection 7.1.6),

EXIT_FAILURE

and

EXIT_SUCCESS, which expand to integral expressions that may be used as the argument to the exit function to return unsuccessful or successful termination status respectively, to the host environment,

RAND_MAX which expands to an integral constant expression, the value of which is the maximum value returned by the rand function, and

MB_CUR_MAX which expands to a positive integer expression whose value is the maximum number of bytes in a multi-byte character for the extended character set specified by the current locale (category LC_TYPE), and whose value is never greater than MB_LEN_MAX

10.1. String Conversion Functions