27 Strings library [strings]

27.5 Null-terminated sequence utilities [c.strings]

27.5.1 Header <cstring> synopsis [cstring.syn]

namespace std { using size_t = see [support.types.layout]; // 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; see [library.c] void* memchr(void* s, int c, size_t n); // freestanding; see [library.c] const char* strchr(const char* s, int c); // freestanding; see [library.c] char* strchr(char* s, int c); // freestanding; see [library.c] size_t strcspn(const char* s1, const char* s2); // freestanding const char* strpbrk(const char* s1, const char* s2); // freestanding; see [library.c] char* strpbrk(char* s1, const char* s2); // freestanding; see [library.c] const char* strrchr(const char* s, int c); // freestanding; see [library.c] char* strrchr(char* s, int c); // freestanding; see [library.c] size_t strspn(const char* s1, const char* s2); // freestanding const char* strstr(const char* s1, const char* s2); // freestanding; see [library.c] char* strstr(char* s1, const char* s2); // freestanding; see [library.c] char* strtok(char* s1, const char* s2); void* memset(void* s, int c, size_t n); // freestanding char* strerror(int errnum); size_t strlen(const char* s); // freestanding } #define NULL see [support.types.nullptr] // freestanding
The contents and meaning of the header <cstring> are the same as the C standard library header <string.h>.
The functions strerror and strtok are not required to avoid data races.
The functions memcpy and memmove are signal-safe.
Each of these functions implicitly creates objects ([intro.object]) in the destination region of storage immediately prior to copying the sequence of characters to the destination.
Each of these functions returns a pointer to a suitable created object, if any, otherwise the value of the first parameter.
[Note 1: 
The functions strchr, strpbrk, strrchr, strstr, and memchr, have different signatures in this document, but they have the same behavior as in the C standard library.
— end note]
See also: ISO/IEC 9899:2018, 7.24