#include <stdio.h>
int fun(char *str1)
{
char *str2 = str1;
while(*++str1);
return (str1-str2);
}
int main()
{
char *str = "GeeksQuiz";
char *str1 = str;
printf("%d", fun(str));
return 0;
}
str1 and str2 pointing to the same string , str1 is incrementing while str2 is still pointing to the first element, so the difference (str1 - str2) should be 51, but it shows 9, please help me to understand.