<stdlib.h>

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 _debug_trealloc _lrotl _srotl
_atold _dump_allocated _llrotl _srotr
_beginthread _dump_allocated_delta _lrotr strtold
_crotl _ecvt _llrotr swab
_crotr _enable _ltoa _tcalloc
csid _endthread _makepath _tdump_allocated
_debug_calloc _exit max _tdump_allocated_delta
_debug_free _fcvt min _debug_heapmin
_freemod _msize _tfree _debug_malloc
_fullpath _onexit _theap_check _debug_realloc
_gcvt __parmdwords _theapmin _debug_tcalloc
_heapmin putenv _threadstore _debug_tfree
_heap_check _rotl _tmalloc _debug
_interrupt _rotr _trealloc _theapmin
_itoa rpmatch _ultoa _debug_tmalloc
_loadmod _searchenv _ulltoa _splitpath

Notes:

  1. To use the debug memory management functions (_debug_calloc, _dump_allocated, and so on), you must compile with the debug memory (/Tm) option.
  2. To use the tiled memory management functions (_tcalloc and so on) you must compile with the tiled memory (/Gt) option.
  3. To use tiled debug functions (_debug_tcalloc, _tdump_allocated, and so on), you must compile with the debug memory (/Tm) and tiled memory (/Gt) options.

<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