I can't understand this code segment. What I think I know is that when I pass "abc"
then x
becomes a pointer to first element in string is this correct? and why is it giving me infinite loop?
Here's my code:
void foo1(char* x)
{
if (!x)
return;
printf("%c ",*x);
foo1(++x);
}
int main()
{
foo1("abc");
return 0;
}