I am asking the above stated weird question to only improve my understanding about dynamic memory allocation.
In addition to above question I run the following code snippet on codepad.org.
void main()
{
static int a = 10;
int* b = &a;
free(b);
}
I am getting "Segmentation fault" message on output window.What is this?May be I am accessing restricted memory through free()?
Also If a don't Initialize 'a' then Nothing is displayed on output window. Please help me out understanding this behavior.