Standard library header <cstring>
From cppreference.com
This header was originally in the C standard library as <string.h>.
This header is for C-style null-terminated byte strings.
Macros | ||
implementation-defined null pointer constant (macro constant) | ||
Types | ||
unsigned integer type returned by the sizeof operator (typedef) | ||
Functions | ||
String manipulation | ||
copies one string to another (function) | ||
copies a certain amount of characters from one string to another (function) | ||
concatenates two strings (function) | ||
concatenates a certain amount of characters of two strings (function) | ||
transform a string so that strcmp would produce the same result as strcoll (function) | ||
String examination | ||
returns the length of a given string (function) | ||
compares two strings (function) | ||
compares a certain number of characters from two strings (function) | ||
compares two strings in accordance to the current locale (function) | ||
finds the first occurrence of a character (function) | ||
finds the last occurrence of a character (function) | ||
returns the length of the maximum initial segment that consists of only the characters found in another byte string (function) | ||
returns the length of the maximum initial segment that consists of only the characters not found in another byte string (function) | ||
finds the first location of any character from a set of separators (function) | ||
finds the first occurrence of a substring of characters (function) | ||
finds the next token in a byte string (function) | ||
Character array manipulation | ||
searches an array for the first occurrence of a character (function) | ||
compares two buffers (function) | ||
fills a buffer with a character (function) | ||
copies one buffer to another (function) | ||
moves one buffer to another (function) | ||
Miscellaneous | ||
returns a text version of a given error code (function) |
[edit]Notes
- NULL is also defined in the following headers:
- std::size_t is also defined in the following headers:
[edit]Synopsis
namespace std {using size_t =/* see description */;// freestanding void* memcpy(void* s1, constvoid* s2, size_t n);// freestandingvoid* memmove(void* s1, constvoid* s2, size_t n);// freestandingchar* strcpy(char* s1, constchar* s2);// freestandingchar* strncpy(char* s1, constchar* s2, size_t n);// freestandingchar* strcat(char* s1, constchar* s2);// freestandingchar* strncat(char* s1, constchar* s2, size_t n);// freestandingint memcmp(constvoid* s1, constvoid* s2, size_t n);// freestandingint strcmp(constchar* s1, constchar* s2);// freestandingint strcoll(constchar* s1, constchar* s2);int strncmp(constchar* s1, constchar* s2, size_t n);// freestanding size_t strxfrm(char* s1, constchar* s2, size_t n);constvoid* memchr(constvoid* s, int c, size_t n);// freestandingvoid* memchr(void* s, int c, size_t n);// freestandingconstchar* strchr(constchar* s, int c);// freestandingchar* strchr(char* s, int c);// freestanding size_t strcspn(constchar* s1, constchar* s2);// freestandingconstchar* strpbrk(constchar* s1, constchar* s2);// freestandingchar* strpbrk(char* s1, constchar* s2);// freestandingconstchar* strrchr(constchar* s, int c);// freestandingchar* strrchr(char* s, int c);// freestanding size_t strspn(constchar* s1, constchar* s2);// freestandingconstchar* strstr(constchar* s1, constchar* s2);// freestandingchar* strstr(char* s1, constchar* s2);// freestandingchar* strtok(char* s1, constchar* s2);// freestandingvoid* memset(void* s, int c, size_t n);// freestandingchar* strerror(int errnum); size_t strlen(constchar* s);// freestanding} #define NULL /* see description */ // freestanding