A
Anoop
Hi guys
i have a piece of code
main()
{
switch(...)
{
case 1:
{
char a[200];
}
case 2:
{
char a[200];
}
case 3:
{
char a[200];
}
}
}
now the question is what will be the memory allocated when the program
enters his function to the first statement switch(...)
1. will it be 600 bytes - sum of all local variables
2. or the allocation will be done depending upon execution path and in
whichever case it goes.
Whatever is the answer? Kindly give proper reasons why will that
happen and also any compiler dependebt issues.
Thanx in Advance
Anoop
i have a piece of code
main()
{
switch(...)
{
case 1:
{
char a[200];
}
case 2:
{
char a[200];
}
case 3:
{
char a[200];
}
}
}
now the question is what will be the memory allocated when the program
enters his function to the first statement switch(...)
1. will it be 600 bytes - sum of all local variables
2. or the allocation will be done depending upon execution path and in
whichever case it goes.
Whatever is the answer? Kindly give proper reasons why will that
happen and also any compiler dependebt issues.
Thanx in Advance
Anoop