转自VC错误:http://www.vcerror.com/?p=1961
问题描述:
代码:
int main()
{
int a =0;
switch(a)
{
case 0: int b = 0;break;
case 1: break;
default:break;
}
return 0;
}
编译器提示错误:
In function ‘int main()’:
error: jump to case label
error: crosses initialization of ‘int b’
error: jump to case label
error: crosses initialization of ‘int b’
解决方法:
具体的解决方法参考文章:http://www.vcerror.com/?p=1961
问题描述:
代码:
int main()
{
int a =0;
switch(a)
{
case 0: int b = 0;break;
case 1: break;
default:break;
}
return 0;
}
编译器提示错误:
In function ‘int main()’:
error: jump to case label
error: crosses initialization of ‘int b’
error: jump to case label
error: crosses initialization of ‘int b’
解决方法:
具体的解决方法参考文章:http://www.vcerror.com/?p=1961