65,196
社区成员




#include <iostream>
using namespace std;
class MyString
{
public:
operator int()
{
return 2;
}
};
int main()
{
MyString s;
switch(s)
{
case 2:
cout<<"ss"<<endl;
}
}
switch (expression) // 括号里是一个表达式,结果是个整数
{
case constant1: // case 后面的标号,也是个整数
group of statements 1;
break;
case constant2:
group of statements 2;
break;
.
.
.
default:
default group of statements
}