When is the garbage colletor called in c...Like in the following code
int main()
{
int *i;
int *fun();
i=fun();
printf("%d\n",*i);
printf("%d\n",*i);
}
int *fun()
{
int k=12;
return(&k);
}
the address being returned is of a variable that is no longer available....but printf statement prints 12 first time and garbage value second time...Can anyone explain the reason...