The following function will calculate the length of a given string
int strlength(char *s)
{
int len=0;
while(s[len]) //repeat until a null character is found
++len;
return len;
}
int strlength(char *s)
{
int len=0;
while(s[len]) //repeat until a null character is found
++len;
return len;
}
No comments:
Post a Comment