C标准库stdlib.h概况

库变量

size_t  这是无符号整数类型,它是 sizeof 关键字的结果

wchar_t  这是一个宽字符常量大小的整数类型。

div_t  这是 div 函数返回的结构

ldiv_t  这是 ldiv 函数返回的结构

库宏

NULL 这个宏是一个空指针常量的值

EXIT_FAILURE 这是 exit 函数失败时要返回的值

EXIT_SUCCESS 这是 exit 函数成功时要返回的值

RAND_MAX  这个宏是 rand 函数返回的最大值

MB_CUR_MAX  这个宏表示在多字节字符集中的最大字符数,不能大于 MB_LEN_MAX

库函数

时间: 2024-08-08 19:27:27

C标准库stdlib.h概况的相关文章

C 标准库 - <stdarg.h>

C 标准库 - <stdarg.h> 简介 stdarg.h 头文件定义了一个变量类型 va_list 和三个宏,这三个宏可用于在参数个数未知(即参数个数可变)时获取函数中的参数. 可变参数的函数通在参数列表的末尾是使用省略号(,...)定义的. 库变量 下面是头文件 stdarg.h 中定义的变量类型: 序号 变量 & 描述 1 va_list 这是一个适用于 va_start().va_arg() 和 va_end() 这三个宏存储信息的类型. 库宏 下面是头文件 stdarg.h

C 标准库 - &lt;string.h&gt;

C 标准库 - <string.h> 简介 string .h 头文件定义了一个变量类型.一个宏和各种操作字符数组的函数. 库变量 下面是头文件 string.h 中定义的变量类型: 序号 变量 & 描述 1 size_t 这是无符号整数类型,它是 sizeof 关键字的结果. 库宏 下面是头文件 string.h 中定义的宏: 序号 宏 & 描述 1 NULL这个宏是一个空指针常量的值. 库函数 下面是头文件 string.h 中定义的函数: 序号 函数 & 描述 1

C 标准库 - &lt;assert.h&gt;

简介 C 标准库的 assert.h头文件提供了一个名为 assert 的宏,它可用于验证程序做出的假设,并在假设为假时输出诊断消息. 已定义的宏 assert 指向另一个宏 NDEBUG,宏 NDEBUG 不是 <assert.h> 的一部分.如果已在引用 <assert.h> 的源文件中定义 NDEBUG 为宏名称,则 assert 宏的定义如下: #define assert(ignore) ((void)0) 库宏 下面列出了头文件 assert.h 中定义的唯一的函数:

C 标准库 - string.h之strncpy使用

strncpy 把 src 所指向的字符串复制到 dest,最多复制 n 个字符.当 src 的长度小于 n 时,dest 的剩余部分将用空字节填充. char *strncpy(char *destination, const char *source, size_t num) Parameters destination Pointer to the destination array where the content is to be copied. 指向用于存储复制内容的目标数组. s

C 标准库 - string.h之strcat使用

strcat Appends a copy of the source string to the destination string. The terminating null character in destination is overwritten by the first character of source, and a null-character is included at the end of the new string formed by the concatena

C 标准库 - string.h之strspn使用

strspn Returns the length of the initial portion of str1 which consists only of characters that are part of str2. The search does not include the terminating null-characters of either strings, but ends there. 检索字符串 dest 中第一个不在字符串 src 中出现的字符下标.返回 dest

C 标准库 - string.h之strpbrk使用

strpbrk Locate characters in string,Returns a pointer to the first occurrence in str1 of any of the characters that are part of str2, or a null pointer if there are no matches. The search does not include the terminating null-characters of either str

C 标准库 - string.h之strlen使用

strlen Returns the length of the C string str. The length of a C string is determined by the terminating null-character: A C string is as long as the number of characters between the beginning of the string and the terminating null character (without

C 标准库 - string.h之memchr使用

memchr Locate character in block of memory,Searches within the first num bytes of the block of memory pointed by ptr for the first occurrence of ch (interpreted as an unsigned char), and returns a pointer to it. 在参数 ptr 所指向的字符串的前 count 个字节中搜索第一次出现字符