strlen function tells the string length
Syntax
C strlen function has the following syntax.
size_t strlen(const char *str);
Header
C strlen function
is from header file string.h
.
Description
C strlen function returns the string length. The null terminator is not counted.
Example
Use C strlen function to get the string length.
#include<string.h>
#include<stdio.h>
/*w w w . j a v a2s. c om*/
int main(void){
printf("%d", strlen("hello"));
}
The code above generates the following result.