General Utilities: stdlib.h

The ANSI C standard library includes a variety of utility functions defined in stdlib.h. The header file defines the types shown in Table F.13.

Table F.13. Types defined in stdlib.h.
TypeDescription
size_tThe integer type returned by the sizeof operator.
wchar_tThe integer type used to represent wide characters.
div_tThe structure type returned by div(); it has a quot and a rem member, both of type int.
ldiv_tThe structure type returned by ldiv(); it has a quot and a rem member, both of type long.

The header file defines the constants listed in Table F.14.

Table F.14. Constants defined in stdlib.h.
TypeDescription
NULLThe null pointer (equivalent to 0).
EXIT_FAILURECan be used as an argument to exit() to indicate unsuccessful ...

Get C Primer Plus®, Third Edition 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.