Strlen( ) function :
This function counts the number of characters in a given string.The format of the functions is strlen(string).program in this regard is illustrated below..Program:
#include<stdio.h>
#include<conio.h>
#include<string.h>
void main( )
{
char text[20];
int len;
printf("Type text below");
gets(text);
len=strlen(text);
printf("Lenth of string =%d",len);
}
OUTPUT:
Type text below
Hello
Length of string=5
Explanation:
In the above program strlen( ) function is called.Based address of text array will be sent and in lieu of this the function returns the length of string.It counts the string length with out the NULL character.