void* func1(int a)
{
void *b = &a;
return b;
}
int main(int argc, char** argv) {
int d = 9;
void *c = func1(d);
printf("%d\n", *((int*)c));
return 0;
}
I am confused about why it works.
From my understanding, memory of "a" will release after func1.
Why the void* c can still access "a" after finish the function?