R
Rahul
Hi Everyone,
I have the following program,
class A
{
int i;
};
int main()
{
switch(1)
{
case 1 :
// {
A obj;
printf("case 1\n");
// }
break;
case 2 :
A obj1;
printf("case 2\n");
break;
}
}
and when i compile, i get an compilation error, saying,
jump to case symbol
enters scope of non-POD 'A obj'
but if i remove the commented open and close brace, it works just
fine, could anyone clarify the exact reason of the compiler reporting
the error,
Thanks in advance!!!
I have the following program,
class A
{
int i;
};
int main()
{
switch(1)
{
case 1 :
// {
A obj;
printf("case 1\n");
// }
break;
case 2 :
A obj1;
printf("case 2\n");
break;
}
}
and when i compile, i get an compilation error, saying,
jump to case symbol
enters scope of non-POD 'A obj'
but if i remove the commented open and close brace, it works just
fine, could anyone clarify the exact reason of the compiler reporting
the error,
Thanks in advance!!!