Say I have something like ...
void foo()
{
char c[100];
printf("this function does nothing useful");
}
When foo is called, it creates an array on the stack, and when it goes out of scope, is memory freed automatically? Or is c destroyed, but the memory remains allocated, without the ability to access / get it, except for restarting the computer?
source
share