Function name : strlen
Header file : <string.h>
Function prototype : int strlen(const char *str);
Function : Calculate string length
Parameters : const char *str is the string to be calculated
Return value : Returns the length of the string str
Program example : Calculate the length of string str
#include<stdio.h>#include<string.h>intmain(void){char*str=www.dotcpp.com;intlen=strlen(str);printf(The length of %s is %dn,str, len);return0;}
Running results:
The length of www.dotcpp.com is 14