| Memory Management |
malloc() |
Allocates a block of memory. |
| calloc() |
Allocates and initializes a block of memory. |
| realloc() |
Resizes a previously allocated block of memory. |
| free() |
Deallocates previously allocated memory. |
| Random Number Generation |
rand() |
Generates a pseudo-random number. |
| srand() |
Seeds the random number generator with a specific value. |
| Process Control |
exit() |
Terminates the program immediately. |
| abort() |
Abnormally terminates the program. |
| atexit() |
Registers a function to be executed upon program termination. |
| system() |
Executes a system command. |
| Type Conversion |
atoi() |
Converts a string to an integer. |
| atol() |
Converts a string to a long integer. |
| atof() |
Converts a string to a floating-point number. |
| strtol() |
Converts a string to a long integer with error checking. |
| strtoll() |
Converts a string to a long long integer with error checking. |
| strtoul() |
Converts a string to an unsigned long integer with error checking. |
| strtoull() |
Converts a string to an unsigned long long integer with error checking. |
| strtod() |
Converts a string to a double with error checking. |
| strtof() |
Converts a string to a float with error checking. |
| strtold() |
Converts a string to a long double with error checking. |
| Searching and Sorting |
qsort() |
Performs a quick sort on an array. |
| bsearch() |
Performs a binary search in a sorted array. |
| Mathematical Utilities |
abs() |
Returns the absolute value of an integer. |
| labs() |
Returns the absolute value of a long integer. |
| llabs() |
Returns the absolute value of a long long integer. |
| div() |
Computes quotient and remainder of integer division. |
| ldiv() |
Computes quotient and remainder of long integer division. |
| lldiv() |
Computes quotient and remainder of long long integer division. |
| Environment Handling |
getenv() |
Retrieves the value of an environment variable. |
| putenv() |
Adds or changes an environment variable. |
| setenv() |
Sets a new environment variable. |
| unsetenv() |
Removes an environment variable. |
| Multibyte and Wide-Character Conversion |
mblen() |
Returns the number of bytes in the next multibyte character. |
| mbstowcs() |
Converts a multibyte string to a wide-character string. |
| mbtowc() |
Converts a multibyte character to a wide character. |
| wcstombs() |
Converts a wide-character string to a multibyte string. |
| wctomb() |
Converts a wide character to a multibyte character. |
| Dynamic Allocation for Array |
aligned_alloc() |
Allocates memory with a specified alignment. |