The <stdlib.h> header defines several general operation functions and macros.
The <stdlib.h> header shall define the following macro constant:
The <stdlib.h> header shall define the following functions:
String conversion:
Pseudo-random sequence generation:
Dynamic memory management:
Environment:
Searching and sorting:
Integer arithmetics:
Multi-byte characters:
Multibyte strings:
The <stdlib.h> header shall define the following type:
Related topics:
<setdef.h> | <stdint.h> | <stdio.h> | <stdnoreturn.h> | <string.h> | Standard Library in C
List of topics: C Programming
The <stdlib.h> header shall define the following macro constant:
| EXIT_SUCCESS EXIT_FAILURE | indicates program execution execution status |
| MB_CUR_MAX | Maximum size of multibyte characters |
| NULL | Null pointer |
| RAND_MAX | maximum possible value generated by rand() |
The <stdlib.h> header shall define the following functions:
String conversion:
| atof | converts a byte string to a floating point value |
| atoi atol atoll | converts a byte string to an integer value int, long, long long(C99) |
| strtol strtoll | converts a byte string to an integer value long, long long(C99) |
| strtoul strtoull | converts a byte string to an unsigned integer value long, long long(C99) |
| strtof strtod strtold | converts a byte string to a floating point value float(C99), double, long double(C99) |
Pseudo-random sequence generation:
| rand | generates a pseudo-random number |
| srand | seeds pseudo-random number generator |
Dynamic memory management:
| malloc | allocates memory |
| calloc | allocates and zeroes memory |
| realloc | expands previously allocated memory block |
| free | deallocates previously allocated memory |
| aligned_alloc | allocates aligned memory (C11) |
Environment:
| abort | causes abnormal program termination (without cleaning up) |
| exit | causes normal program termination with cleaning up |
| quick_exit | causes normal program termination without completely cleaning up (C11) |
| _Exit | causes normal program termination without cleaning up (C99) |
| atexit | registers a function to be called on exit() invocation |
| at_quick_exit | registers a function to be called on quick_exit invocation (C11) |
| system | calls the host environment's command processor |
| getenv getenv_s(C11) | access to the list of environment variables |
Searching and sorting:
| bsearch | Binary search in array |
| qsort | Sort elements of array |
Integer arithmetics:
| abs | Absolute value |
| div | Integral division |
| labs | Absolute value |
| ldiv | Integral division |
| llabs | Absolute value |
| lldiv | Integral division |
Multi-byte characters:
| mblen | returns the number of bytes in the next multibyte character |
| mbtowc | converts the next multibyte character to wide character |
| wctomb wctomb_s(C11) | converts a wide character to its multibyte representation |
Multibyte strings:
| mbstowcs mbstowcs_s(C11) | converts a narrow multibyte character string to wide string |
| wcstombs wcstombs_s(C11) | converts a wide string to narrow multibyte character string |
The <stdlib.h> header shall define the following type:
| div_t | Structure returned by div(struct) |
| ldiv_t | Structure returned by ldiv(struct) |
| lldiv_t | Structure returned by lldiv(struct) |
| size_t | Unsigned integral type |
Related topics:
<setdef.h> | <stdint.h> | <stdio.h> | <stdnoreturn.h> | <string.h> | Standard Library in C
List of topics: C Programming
No comments:
Post a Comment