C Language: strlen function
(String Length)
In the C Programming Language, the strlen function returns the length of the string pointed to by s. It does not include the null character in the length calculation.
Syntax
The syntax for the strlen function in the C Language is:
size_t strlen(const char *s);
Parameters or Arguments
- s
- The string whose length you want to calculate.
Returns
The strlen function returns the length of the string pointed to by s. It does not include the null character in the length calculation.
Required Header
In the C Language, the required header for the strlen function is:
#include <string.h>
Applies To
In the C Language, the strlen function can be used in the following versions:
- ANSI/ISO 9899-1990
Advertisements