/* http://native-code.blogspot.com */
#include<stdio.h>
#include<conio.h>
int myfunc(char *s)
{
int len=0;
while(*s!='\0')
{
len++;
s++;
}
return(len);
}
void main()
{
char ch[10];
printf(" /* http://native-code.blogspot.com */ \n\n please enter string: ");
gets(ch);
int i;
i=myfunc(ch);
printf("\n length=%d",i);
getch();
}
/* http://native-code.blogspot.com */
Home
» C
» Function
» Pointer
» String
» How to find length of a string by using function in C program?

Post a Comment