名稱空間
變體
操作

標準庫標頭檔案 <cstring>

來自 cppreference.com
 
 
標準庫標頭檔案
演算法
<algorithm>
<numeric>
字串
<cctype>
<cstring>
<cuchar> (C++11)
<cwchar>
<cwctype>
<string_view> (C++17)
<string>
文字處理
<clocale>
<codecvt> (C++11/17/26*)
<locale>
<regex> (C++11)
<text_encoding> (C++26)   
數值
<cfenv> (C++11)
<cmath>
<complex>
<linalg> (C++26)
<numbers> (C++20)
<random> (C++11)
<simd> (C++26)
<valarray>
時間
<chrono> (C++11)
<ctime>
C 相容性
<ccomplex> (C++11/17/20*)
<ciso646> (直到 C++20)
<cstdalign> (C++11/17/20*)
<cstdbool> (C++11/17/20*)
<ctgmath> (C++11/17/20*)
 

此標頭檔案最初是 C 標準庫中的 <string.h>

此標頭檔案用於C 風格的空終止位元組字串

目錄

實現定義的空指標常量
(宏常量) [編輯]

型別

sizeof 運算子返回的無符號整型
(typedef) [編輯]

函式

字串操作
將一個字串複製到另一個字串
(函式) [編輯]
從一個字串複製一定數量的字元到另一個字串
(函式) [編輯]
連線兩個字串
(函式) [編輯]
連線兩個字串的特定數量的字元
(函式) [編輯]
轉換字串,使 strcmp 產生與 strcoll 相同的結果
(函式) [編輯]
字串檢查
返回給定字串的長度
(函式) [編輯]
比較兩個字串
(函式) [編輯]
比較兩個字串的特定數量的字元
(函式) [編輯]
根據當前區域設定比較兩個字串
(函式) [編輯]
查詢字元的第一次出現
(函式) [編輯]
查詢字元的最後一次出現
(函式) [編輯]
返回由另一個位元組字串中找到的字元組成的最大初始段的長度
的字元
(函式) [編輯]
返回由另一個位元組字串中找到的字元組成的最大初始段的長度
僅由另一個位元組字串中未找到的字元組成
(函式) [編輯]
查詢分隔符集中任何字元的第一個位置
(函式) [編輯]
查詢字元子字串的第一次出現
(函式) [編輯]
查詢位元組字串中的下一個標記
(函式) [編輯]
字元陣列操作
在陣列中搜索字元的第一次出現
(函式) [編輯]
比較兩個緩衝區
(函式) [編輯]
用字元填充緩衝區
(函式) [編輯]
將一個緩衝區複製到另一個緩衝區
(函式) [編輯]
將一個緩衝區移動到另一個緩衝區
(函式) [編輯]
雜項
返回給定錯誤程式碼的文字版本
(函式) [編輯]

[編輯] 注意

[編輯] 概要

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