C strlen()

The strlen() function returns the length of the given string. It doesn't count null character '\0'.

snippet
#include
#include   
int main(){  
char ch[20]={'r', 'o', 'o', 'k', 'i', 'e', 'n', 'e', 'r', 'd', '\0'};  
   printf("Length of string is: %d",strlen(ch));  
 return 0;  
}

Output:

Output
Length of string is: 10
Related Tutorial
Follow Us
https://www.facebook.com/Rookie-Nerd-638990322793530 https://twitter.com/RookieNerdTutor https://plus.google.com/b/117136517396468545840 #
Contents +