【发布时间】:2011-05-09 14:09:30
【问题描述】:
enum options {Yes,No};
class A{
int i;
string str;
options opt;
};
int main{
A obj;
obj.i=5;
obj.str="fine";
obj.opt="Yes"; // compiler error
}
如何分配const char * 来选择?
【问题讨论】:
标签: c++ string enums enumeration