The <stdlib.h> include file declares the following functions:
| abort | bsearch | llabs | qsort | strtoul |
| abs | calloc | ldiv | rand | strtoull |
| atexit | div | lldiv | realloc | system |
| atof | exit | malloc | srand | wctomb |
| atoi | free | mblen | strtod | wcstombs |
| atol | getenv | mbstowcs | strtol | |
| atoll | labs | mbtowc | strtoll |
In extended mode, <stdlib.h> also defines the following standard extensions:
| _alloca | _lrotl | _srotl | |
| _atold | _dump_allocated | _llrotl | _srotr |
| _beginthread | _dump_allocated_delta | _lrotr | strtold |
| _crotl | _ecvt | _llrotr | swab |
| _crotr | _enable | _ltoa | |
| csid | _endthread | _makepath | |
| _debug_calloc | _exit | max | |
| _debug_free | _fcvt | min | _debug_heapmin |
| _freemod | _msize | _debug_malloc | |
| _fullpath | _onexit | _debug_realloc | |
| _gcvt | |||
| _heapmin | putenv | _threadstore | |
| _heap_check | _rotl | _debug | |
| _interrupt | _rotr | ||
| _itoa | rpmatch | _ultoa | |
| _loadmod | _searchenv | _ulltoa | _splitpath |
Notes:
<stdlib.h> also contains definitions for the following macros:
| NULL | The NULL pointer value. The value of NULL is 0 when in extended mode; otherwise, its value is ((void*)0). NULL is also defined in <locale.h>. |
| EXIT_SUCCESS | Expands to 0; used by the atexit function. |
| EXIT_FAILURE | Expands to 8; 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 integral expression representing the maximum number of bytes in a multibyte character for the current locale. |
On OS/2 and Windows, in extended mode, <stdlib.h> also defines the following global variables:
| _doserrno | _environ |
| errno | onexit_t |
| _osmajor | _osminor |
| _osmode |
The variable errno, on OS/2 and Windows, is also defined in <stddef.h>. The variable _doserrno is provided in <errno.h>.
On OS/2 and Windows, <stdlib.h> also defines the following far and near pointer macros to the corresponding standard library function:
| _fcalloc | _ffree |
| _fmalloc | _fheapmin |
| _frealloc | _ncalloc |
| _nfree | _nmalloc |
| _nheapmin | _nrealloc |
These macros are also defined in <malloc.h>.
![]()
<locale.h>
<errno.h>
<malloc.h>
<stddef.h>
<stdio.h>
#include