string literals

Constructs an unnamed object of specified character array type in-place, used when a character string needs to be embedded in source code. Syntax " s-char-sequence " (1) u8 " s-char-sequence " (2) (since C11) u " s-char-sequence " (3) (since C11) U " s-char-sequence " (4) (since C11) L " s-char-sequence " (5) where. s-char-sequence - zero or more characters, each of which is either a multibyte character from the source character set (excluding ("), \, and

Strings library

Null-terminated byte string management Null-terminated multibyte string management Null-terminated wide string management See also C++ documentation for Strings library

strncat

Defined in header <string.h> (1) char *strncat( char *dest, const char *src, size_t count ); (until C99) char *strncat( char *restrict dest, const char *restrict src, size_t count ); (since C99) errno_t strncat_s(char *restrict dest, rsize_t destsz, const char *restrict src, rsize_t count); (2) (since C11) 1) Appends at most count characters from the character array pointed to by src, stopping if the null character is found, to the end of the

strlen

Defined in header <string.h> size_t strlen( const char *str ); (1) size_t strnlen_s( const char *str, size_t strsz ); (2) (since C11) 1) Returns the length of the given null-terminated byte string, that is, the number of characters in a character array whose first element is pointed to by str up to and not including the first null character. The behavior is undefined if str is not a pointer to a null-terminated byte string. 2) Same as (1), except that the function

strcspn

Defined in header <string.h> size_t strcspn( const char *dest, const char *src ); Returns the length of the maximum initial segment of the null-terminated byte string pointed to by dest, that consists of only the characters not found in the null-terminated byte string pointed to by src. The behavior is undefined if either dest or src is not a pointer to a null-terminated byte string. Parameters dest - pointer to the null-terminated byte string to be analyzed src

strcoll

Defined in header <string.h> int strcoll( const char *lhs, const char *rhs ); Compares two null-terminated byte strings according to the current locale as defined by the LC_COLLATE category. Parameters lhs, rhs - pointers to the null-terminated byte strings to compare Return value Negative value if lhs is less than (precedes) rhs. ​0​ if lhs is equal to rhs. Positive value if lhs is greater than (follows) rhs. Notes Collation order is the dictionary order:

strcmp

Defined in header <string.h> int strcmp( const char *lhs, const char *rhs ); Compares two null-terminated byte strings lexicographically. The sign of the result is the sign of the difference between the values of the first pair of characters (both interpreted as unsigned char) that differ in the strings being compared. The behavior is undefined if lhs or rhs are not pointers to null-terminated byte strings. Parameters lhs, rhs - pointers to the null-terminated byte

strcpy

Defined in header <string.h> (1) char *strcpy( char *dest, const char *src ); (until C99) char *strcpy( char *restrict dest, const char *restrict src ); (since C99) errno_t strcpy_s(char *restrict dest, rsize_t destsz, const char *restrict src); (2) (since C11) 1) Copies the null-terminated byte string pointed to by src, including the null terminator, to the character array whose first element is pointed to by dest. The behavior is undefined if the dest array

strerror

Defined in header <string.h> char* strerror( int errnum ); (1) errno_t strerror_s( char *buf, rsize_t bufsz, errno_t errnum ); (2) (since C11) size_t strerrorlen_s( errno_t errnum ); (3) (since C11) 1) Returns a pointer to the textual description of the system error code errnum, identical to the description that would be printed by perror(). errnum is usually acquired from the errno variable, however the function accepts any value of type int. The contents of

strcat

Defined in header <string.h> (1) char *strcat( char *dest, const char *src ); (until C99) char *strcat( char *restrict dest, const char *restrict src ); (since C99) errno_t strcat_s(char *restrict dest, rsize_t destsz, const char *restrict src); (2) (since C11) 1) Appends a copy of the null-terminated byte string pointed to by src to the end of the null-terminated byte string pointed to by dest. The character src[0] replaces the null terminator at the end of de