Hi,
I don't understand this. Why the result is always 0. have a look at this code
As u can see in the function test. It has been called recu incrementing count by 1 every time it call back. why it dost show the value 0 - 9 rather than to be infinite loop with just 0.Code:#include<stdio.h> int count; void test(int count) { if(count==10) return; else { printf("%d\n",count); test(count++); } } int main() { test(0); getchar(); return 0; }
But when it refers int global value count we get the right answer. Thats right, but the local variable count is not why??
ssharish2005