What is strlen function in C language | Detail

A  strlen( ) function in C is basically used to find whats the length of the string in the program.

What is strlen function in C language
strlen() in C

In this article we will learn about strlen( ), string function in detail in which we will discuss following topics...
  1. strlen function in c
  2. strlen function in c example
  3. strlen function in c syntax
  4. header file for strlen function in c

strlen( ) function in C

strcpy( ) function is also known as a built in function or standard library function of C but it is widely know as string function. strlen( ) function is basically used to measure length of the string with excluding null character.

Header file for strlen( ) function in C

strlen( ) function is a built in function of C and it is define in <string.h> header file.

strlen( ) function in C syntax

strlen( str); or n=strlen(str);

where n is defined variable in which return value of strlen function is stored.

strlen( ) function in C example

#include<stdio.h>
#include<string.h>
int main()
{

  int n;
  char str[15]="Akash";
  n=strlen(str);
  printf("%d",n);
return 0;
}

____________________________________

What is strlen function in c language

____________________________________

Conclusion

A  strlen( ) function in C is basically used to find whats the length of the string in the program.
Post a Comment (0)
Previous Post Next Post