stdlib.h
Description:
Declares common functions used for performing I/O operations.
You can use the functions provided in this file to complete string conversion, random number generation, array sorting, and tree-related operations during development.
Since:
1.0
Version:
1.0
atol (const char nptr) |
|
atof (const char nptr) |
Converts an input string to a double-precision floating-point number. |
strtod (const char nptr, char endptr) |
|
strtol (const char nptr, char **endptr, int base) |
Converts a string to a long integer according to the given base. |
Converts a string to an unsigned long integer according to the given base. |
|
strtoll (const char *nptr, char endptr, int base) |
Converts a string to a long long integer according to the given base. |
Converts a string to an unsigned long long integer according to the given base. |
|
rand (void) |
|
malloc (size_t size) |
|
realloc (void ptr, size_t size) |
Changes the size of the memory block pointed to by ptr to size bytes. |
abort (void) |
Terminates an abnormal process and sends the SIGABRT signal to the caller. |
Terminates the calling process, clears the used memory space and various data structures in the kernel, and sends the process end status to the parent process. All functions registered with atexit and on_exit are called in the reverse order. |
|
getenv (const char name) |
|
Terminates the calling process, clears the used memory space and various data structures in the kernel, and sends the process end status to the parent process. |
|
assert (scalar expression) |
|
bsearch (const void key, const void base, size_t nel, size_t width, int(compar)(const void , const void )) |
Searches for key using the binary search algorithm from the array element base[0] to base[num-1]. |
(const void base, size_t nel, size_t width, int(compar)(const void , const void )) |
Sorts array elements base[0] to base[num-1] based on the comparison rules of compar. |
abs (int i) |
|
llabs (long long i) |
|
Calculates the quotient and remainder of an integer after division. |
|
Calculates the quotient and remainder of a long integer after division. |
|
Calculates the quotient and remainder of a long long integer after division. |
|
mbtowc (wchar_t pwc, const char s, size_t n) |
|
Converts a wide character to its multi-byte sequence and stores it in a character array. |
|
mbstowcs (wchar_t dest, const char src, size_t n) |
|
posix_memalign (void **memptr, size_t alignment, size_t size) |
Allocates memory with the specified size based on the given alignment. |
unsetenv (const char name) |
|
mkostemp (char template, int flags) |
|
getsubopt (char optionp, char const tokens, char valuep) |
|
random (void) |
|
initstate (unsigned int seed, char state, size_t n) |
|
putenv (char s) |
|
Unlocks the secondary pseudo terminal corresponding to a primary pseudo terminal. |
|
ptsname (int fd) |
|
a64l (const char str64) |
Converts between a 32-bit long integer and a little-endian 64-bit ASCII string. |
erand48 (unsigned short xsubi[3]) |
|
Generates pseudo-random numbers evenly distributed between [0, 2^31). |
|
nrand48 (unsigned short xsubi[3]) |
Generates pseudo-random numbers evenly distributed between [0, 2^31). |
Generates pseudo-random numbers evenly distributed between [-2^31, 2^31). |
|
jrand48 (unsigned short xsubi[3]) |
Generates pseudo-random numbers evenly distributed between [-2^31, 2^31). |
Sets the start seed value for the pseudo-random number generator. |
|
seed48 (unsigned short[3]) |
|
Sets the seed and related algorithm parameters for the pseudo-random number generator. |
|
mktemp (char template) |
|
mkostemps (char template, int suffixlen, int flags) |
|
Allocates memory with the specified size and aligns the allocated memory by page size. |
|
ecvt (double number, int ndigits, int decpt, int sign) |
Converts a double-precision floating-point number into a string. |
gcvt (double x, int n, char b) |