#include<iostream>
using namespace std;
class fun
{
public :
fun():w(0){}
fun(int t):w(t){}
int getcalue(){return w;}
private :
int w;
};
int main()
{
class fun Fun(6);
//若在此定义m,则这个m作用域为main函数。
// int m=Fun.getcalue();
switch(int m=Fun.getcalue())// 此处,m值的范围只在switch 内有效。
{
case 6:
cout<<m<<endl;
break;
default:break;
}
cout<< m <<endl;//编译错误
getchar();
}