How to make strlen() as user defined function in C?

strlen() is a function used to count the number of char.It is a function of c which comes in <string.h>.
Below program will help you build strlen() as a user defined function.#include<stdio.h>
#include<conio.h>
void main ()
{
char a[]={“Abhay””Singh”};
int i=0;
clrscr();
printf(“Your size of array is here\n”);
while(a[i]!=’\0′)
{
i++;
}
printf(“%d”,i);
getch();
}

After Running program 🙂

Leave a Reply