enum枚举类型的输出方式

#include
enum e{a,b,c};
using namespace std;
const int Monday=0;
const int Tuesday=1;
const int Friday=2;
int main(){
e e1;
e1=e(Monday);
int length=sizeof(e);
int IntLength=sizeof(int);
cout< cout<
switch (e1){
case 0:cout<<"Monday"<case 1:cout<<"Tuesday"<case 2:cout<<"Friday"<}
return 0;
}



你可能感兴趣的:(c++)