This is my own strlen function...Code:int strlen(char *s)
{
int len = 0;
while(*s)
s++, len++;
return len;
}
Now i was wandering why do some people do;
char *p = s;
and then use the p pointer in while iteration instead of s itself.
What's the diffrence?Code:int strlen(char *s)
{
int len = 0;
char *p = s;
while(*p)
p++, len++;
return len;
}