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

Strings library

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

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

strftime

Defined in header <time.h> size_t strftime( char * str, size_t count, const char * format, const struct tm * time ); (until C99) size_t strftime( char *restrict str, size_t count, const char *restrict format, const struct tm *restrict time ); (since C99) Converts the date and time information from a given calendar time time to a null-terminated multibyte character string str according to format string format.

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

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

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

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

strchr

Defined in header <string.h> char *strchr( const char *str, int ch ); Finds the first occurrence of ch (after conversion to char as if by (char)ch) in the null-terminated byte string pointed to by str (each character interpreted as unsigned char). The terminating null character is considered to be a part of the string and can be found when searching for '\0'. The behavior is undefined if str is not a pointer to a null-terminated byte string. Parameters str - pointer