Compute the String Length Again
#include <stdio.h>
main()
{
printf("%d\n",
length("This"));
}
int length(char *s)
{
char *p = s;
while(*s)
++s;
return (s-p);
}
This is program
pg346.c
Previous slide
Next slide
Back to first slide
View graphic version