174. C Program to find Length of a String Using Pointers.
How does this program work?
- This Program is used to find length of a string using pointers.
Here is the code
#include <stdio.h>
int main()
{
char str[100], *pt;
int i = 0;
printf("Enter Any string : \n");
gets(str);
pt = str;
while (*pt != '\0')
{
i++;
pt++;
}
printf("Length of String : %d\n", i);
return 0;
}