strlen
strlen, strnlen_s
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.