Home C&C++函数库 c++ 语法 程序源码 Linux C库

<cstdlib>

头文件   (stdlib.h)

C标准通用实用程序库
这个头文件定义了几个通用函数,包括动态内存管理、随机数生成、与环境通信、整数运算、搜索、排序和转换。

☞  函数



字符串转换
atof 将string转换为double(function)
atoi 将string转换为integer(function)
atol 将string转换为 long integer(function)
atoll 将string转换为 long long integer(function)
strtod 将string转换为double (function)
strtof 将string转换为float (function)
strtol 将string转换为long integer(function)
strtold 将string转换为 long double (function)
strtoll 将string转换为long long integer (function)
strtoul 将string转换为unsigned long integer(function)
strtoull 将string转换为unsigned long long integer(function)

伪随机序列生成
rand 产生随机数(function)
srand 初始化随机数生成(function)

动态内存管理
calloc 分配并且以零初始化数组(function)
free 释放内存块(function)
malloc 分配内存块(function)
realloc 重新分配内存块(function)

环境
abort 中止当前进程(function)
atexit 设置退出时要执行的函数(function)
at_quick_exit 设置快速退出时要执行的函数(function)
exit 终止调用进程(function)
getenv 获得环境字符串(function)
quick_exit 快速终止调用的进程(function)
system 执行系统命令(function)
_Exit 终止调用进程(function)

查找与排序
bsearch 数组二进制搜索(function)
qsort 数组元素排序(function)

整数运算
abs 绝对值(function)
div 整数除(function)
labs 绝对值(function)
ldiv 整数除(function)
llabs 绝对值(function)
lldiv 整数除(function)

多字节字符
mblen 获取多字节字符的长度(function)
mbtowc 转换多字节序列为宽字符(function)
wctomb 转换宽字符为多字节序列(function)

多字节字符串
mbstowcs 转换多字节字符串为宽字符字符串(function)
wcstombs 转换宽字符字符串为多字节字符串(function)

☞  宏常量



EXIT_FAILURE 失败终止码(macro )
EXIT_SUCCESS 成功终止码(macro )
MB_CUR_MAX 多字节字符的最大规格(macro )
NULL 空指针(macro )
RAND_MAX 由rand返回的最大值(macro )

☣  类型



div_t div返回的结构(type )
ldiv_t ldiv返回的结构(type )
lldiv_t lldiv返回的结构(type )
size_t 无符号整型(type )

联系我们 免责声明 关于CandCplus 网站地图