标准库头文件 <cstring>
来自 cppreference.cn
此头文件最初在 C 标准库中为 <string.h>。
此头文件用于 C 风格的空终止字节字符串。
宏 | ||
实现定义的空指针常量 (宏常量) | ||
类型 | ||
sizeof 运算符返回的无符号整数类型(类型定义) | ||
函数 | ||
字符串操作 | ||
将一个字符串复制到另一个字符串 (函数) | ||
将一定数量的字符从一个字符串复制到另一个字符串 (函数) | ||
连接两个字符串 (函数) | ||
连接两个字符串的一定数量的字符 (函数) | ||
转换字符串,使 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