[cstring.syn] (original) (raw)

27 Strings library [strings]

27.5 Null-terminated sequence utilities [c.strings]

27.5.1 Header synopsis [cstring.syn]

namespace std { using size_t = see [support.types.layout]; void* memcpy(void* s1, const void* s2, size_t n); void* memmove(void* s1, const void* s2, size_t n); char* strcpy(char* s1, const char* s2); char* strncpy(char* s1, const char* s2, size_t n); char* strcat(char* s1, const char* s2); char* strncat(char* s1, const char* s2, size_t n); int memcmp(const void* s1, const void* s2, size_t n); int strcmp(const char* s1, const char* s2); int strcoll(const char* s1, const char* s2);int strncmp(const char* s1, const char* s2, size_t n); size_t strxfrm(char* s1, const char* s2, size_t n);const void* memchr(const void* s, int c, size_t n); void* memchr(void* s, int c, size_t n); const char* strchr(const char* s, int c); char* strchr(char* s, int c); size_t strcspn(const char* s1, const char* s2); const char* strpbrk(const char* s1, const char* s2); char* strpbrk(char* s1, const char* s2); const char* strrchr(const char* s, int c); char* strrchr(char* s, int c); size_t strspn(const char* s1, const char* s2); const char* strstr(const char* s1, const char* s2); char* strstr(char* s1, const char* s2); char* strtok(char* s1, const char* s2);void* memset(void* s, int c, size_t n); char* strerror(int errnum); size_t strlen(const char* s); } #define NULL see [support.types.nullptr]

The contents and meaning of the header are the same as the C standard library header .

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 functionsstrchr, 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