Namespaces
Variants

Standard library header <cstring>

From zh.cppreference.net
Standard library headers

该头文件最初作为 <string.h> 存在于C标准库中。

此头文件用于 C风格空终止字节字符串 。

目录

宏

实现定义的空指针常量
(宏常量)

类型

sizeof 运算符返回的无符号整数类型
(类型定义)

函数

字符串操作
将一个字符串复制到另一个字符串
(函数)
将指定数量的字符从一个字符串复制到另一个字符串
(函数)
连接两个字符串
(函数)
连接两个字符串的指定数量字符
(函数)
转换字符串,使 strcmp 产生与 strcoll 相同的结果
(函数)
字符串检查
返回给定字符串的长度
(函数)
比较两个字符串
(函数)
比较两个字符串的指定数量字符
(函数)
根据当前区域设置比较两个字符串
(函数)
查找字符的首次出现
(函数)
查找字符的最后一次出现
(函数)
返回仅包含在另一个字节字符串中找到的字符的
最大初始段的长度
(函数)
返回不包含在另一个字节字符串中找到的字符的
最大初始段的长度
(函数)
查找分隔符集合中任意字符的首次出现位置
(函数)
查找字符子串的首次出现
(函数)
查找字节字符串中的下一个标记
(函数)
字符数组操作
在数组中搜索字符的首次出现
(函数)
杂项
返回给定错误码的文本版本
(函数)

注释

摘要

#define __STDC_VERSION_STRING_H__ 202311L

namespace std {
  using size_t = /* implementation-defined */;              // freestanding

  void* memcpy(void* s1, const void* s2, size_t n);         // freestanding
  void* memccpy(void* s1, const void* s2, int c, 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* strdup(const char* s);
  char* strndup(const char* s, size_t size);
  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);
  void* memset(void* s, int c, size_t n);                   // freestanding
  void* memset_explicit(void* s, int c, size_t n);          // freestanding
  char* strerror(int errnum);
  size_t strlen(const char* s);                             // freestanding
}

#define NULL /* implementation-defined */                   // freestanding