Showing posts with label C String Length: strlen() function. Show all posts
Showing posts with label C String Length: strlen() function. Show all posts

Thursday, July 5, 2018

C String Length: strlen() function

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





#include<stdio.h>
#include
int main(){
char ch[20]={'r','a','m','a','\0'};
printf("Length of string is: %d",strlen(ch));
return 0;
}



Output

Length of string is: 4




Instagram