标准库头文件 <cstring>
来自 cppreference.cn
此头文件最初是 C 标准库中的 <string.h>。
此头文件用于C 风格的空终止字节字符串。
宏 | ||
实现定义的空指针常量 (宏常量) | ||
类型 | ||
由 sizeof 运算符返回的无符号整型 (typedef) | ||
函数 | ||
字符串操作 | ||
将一个字符串复制到另一个字符串 (函数) | ||
从一个字符串复制一定数量的字符到另一个字符串 (函数) | ||
连接两个字符串 (函数) | ||
连接两个字符串的特定数量的字符 (函数) | ||
转换字符串,使 strcmp 产生与 strcoll 相同的结果(函数) | ||
字符串检查 | ||
返回给定字符串的长度 (函数) | ||
比较两个字符串 (函数) | ||
比较两个字符串的特定数量的字符 (函数) | ||
根据当前区域设置比较两个字符串 (函数) | ||
查找字符的第一次出现 (函数) | ||
查找字符的最后一次出现 (函数) | ||
返回由另一个字节字符串中找到的字符组成的最大初始段的长度 的字符 (函数) | ||
返回由另一个字节字符串中找到的字符组成的最大初始段的长度 仅由另一个字节字符串中未找到的字符组成 (函数) | ||
查找分隔符集中任何字符的第一个位置 (函数) | ||
查找字符子字符串的第一次出现 (函数) | ||
查找字节字符串中的下一个标记 (函数) | ||
字符数组操作 | ||
在数组中搜索字符的第一次出现 (函数) | ||
比较两个缓冲区 (函数) | ||
用字符填充缓冲区 (函数) | ||
将一个缓冲区复制到另一个缓冲区 (函数) | ||
将一个缓冲区移动到另一个缓冲区 (函数) | ||
杂项 | ||
返回给定错误代码的文本版本 (函数) |
[编辑] 注意
- NULL 也定义在以下头文件中
- std::size_t 也定义在以下头文件中
[编辑] 概要
namespace std { using size_t = /* see description */; // freestanding void* memcpy(void* s1, const void* s2, size_t n); // freestanding void* memmove(void* s1, const void* s2, size_t n); // freestanding char* strcpy(char* s1, const char* s2); // freestanding char* strncpy(char* s1, const char* s2, size_t n); // freestanding char* strcat(char* s1, const char* s2); // freestanding char* strncat(char* s1, const char* s2, size_t n); // freestanding int memcmp(const void* s1, const void* s2, size_t n); // freestanding int strcmp(const char* s1, const char* s2); // freestanding int strcoll(const char* s1, const char* s2); int strncmp(const char* s1, const char* s2, size_t n); // freestanding size_t strxfrm(char* s1, const char* s2, size_t n); const void* memchr(const void* s, int c, size_t n); // freestanding void* memchr(void* s, int c, size_t n); // freestanding const char* strchr(const char* s, int c); // freestanding char* strchr(char* s, int c); // freestanding size_t strcspn(const char* s1, const char* s2); // freestanding const char* strpbrk(const char* s1, const char* s2); // freestanding char* strpbrk(char* s1, const char* s2); // freestanding const char* strrchr(const char* s, int c); // freestanding char* strrchr(char* s, int c); // freestanding size_t strspn(const char* s1, const char* s2); // freestanding const char* strstr(const char* s1, const char* s2); // freestanding char* strstr(char* s1, const char* s2); // freestanding char* strtok(char* s1, const char* s2); // freestanding void* memset(void* s, int c, size_t n); // freestanding char* strerror(int errnum); size_t strlen(const char* s); // freestanding } #define NULL /* see description */ // freestanding