char three_let[13][4]={"emp","Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"};
class Month{
private:
int month;
bool check();
public:
Month(char x[3]); //别的函数我就不写了
}
Month::Month(char x[3]){
int i;
for (i=1; i<14; i++) {
if ((strcmp(three_let[i], x)==0)) {
month=i;
break;
}
}
}
int main(){
Month month3({'J','a','n'});
这里总是报错 说no matching constructor for initialization of 'Month'
我改成Month month3("Jan"); 也不行
说ISO C++11 does not allow conversion from string literal to 'char'
狐的传说
幕布斯6054654
慕标琳琳
随时随地看视频慕课网APP
相关分类