Please see the code below :-
insertWhen i print the value of i in main , i expect it to give a garbage value since the variable i is local to fun.Code:int main(){ int *p; int *fun(); p = fun(); printf("Value of i %d" , *p); getch(); return 0; } int *fun(void){ int i = -214223; return (&i); }
But actually its giving me the correct value.
How is this possible....Please help