C++ Reference: Standard C++ Library reference: C Library: cstdlib

汪鸿波
2023-12-01

C++官网参考链接:https://cplusplus.com/reference/cstdlib/

头文件 
<cstdlib> (stdlib.h)
C标准通用程序库

这个头文件定义了几个通用函数,包括动态内存管理、随机数生成、与环境的通信、整数算术、查找、排序和转换。
函数
字符串转换 
atof    Convert string to double (function)
atoi    Convert string to integer (function)
atol    Convert string to long integer (function)
atoll    Convert string to long long integer (function)
strtod    Convert string to double (function)
strtof    Convert string to float (function)
strtol    Convert string to long integer (function)
strtold    Convert string to long double (function)
strtoll    Convert string to long long integer (function)
strtoul    Convert string to unsigned long integer (function)
strtoull    Convert string to unsigned long long integer (function)
伪随机序列生成 
rand    Generate random number (function)
srand    Initialize random number generator (function)
动态内存管理 
calloc    Allocate and zero-initialize array (function)
free    Deallocate memory block (function)
malloc    Allocate memory block (function)
realloc    Reallocate memory block (function)
环境
abort    Abort current process (function)
atexit    Set function to be executed on exit (function)
at_quick_exit    Set function to be executed on quick exit (function)
exit    Terminate calling process (function)
getenv    Get environment string (function)
quick_exit    Terminate calling process quick (function)
system    Execute system command (function)
_Exit    Terminate calling process (function)
查找和排序 
bsearch    Binary search in array (function)
qsort    Sort elements of array (function)
整数算术 
abs    Absolute value (function)
div    Integral division (function)
labs    Absolute value (function)
ldiv    Integral division (function)
llabs    Absolute value (function)
lldiv    Integral division (function)
多字节字符 
mblen    Get length of multibyte character (function)
mbtowc    Convert multibyte sequence to wide character (function)
wctomb    Convert wide character to multibyte sequence (function)
多字节字符串 
mbstowcs    Convert multibyte string to wide-character string (function)
wcstombs    Convert wide-character string to multibyte string (function)
宏常量 
EXIT_FAILURE    Failure termination code (macro)
EXIT_SUCCESS    Success termination code (macro)
MB_CUR_MAX    Maximum size of multibyte characters (macro)
NULL    Null pointer (macro)
RAND_MAX    Maximum value returned by rand (macro)
类型
div_t    Structure returned by div (type)
ldiv_t    Structure returned by ldiv (type)
lldiv_t    Structure returned by lldiv (type)
size_t    Unsigned integral type (type) 

 类似资料: