C++程序小错误error C2676: binary '||' : 'class std::basic_string<char,struct std::char_tr
{cout<<endl<<"进入信息修改界面"<<endl;cout<<"请输入要修改信息的服装编号"<<endl;intnum;intprice;stringsize(...
{cout<<endl<<"进入信息修改界面"<<endl;
cout<<"请输入要修改信息的服装编号"<<endl;
int num;
int price;
string size("S"),sex;
cin>>num;
while(num%1000>i)
{
cout<<"未注册!!"<<endl;
cout<<"请重新输入:"<<endl;
cin>>num;
}
cout<<" ╭---------服装商店管理系统----------╮"<<endl;
cout<<" ∣ ∣"<<endl;
cout<<" ├-------------------------------------┤"<<endl;
cout<<" ∣ 1.请输入新的服装尺寸(S,M,L,XL,XLL)∣"<<endl;
cout<<" ";
while(!((size="S")||(size="M")||(size="XL")||(size="XXL")||(size="L")))
{
cin>>size;
switch(size)
{
case "S": t[num%1000-1].setsize (size);break;
case "M": t[num%1000-1].setsize (size);break;
case "L": t[num%1000-1].setsize (size);break;
case "XL": t[num%1000-1].setsize (size);break;
case "XXL": t[num%1000-1].setsize (size);break;
default:cout<<"您的输入有误,请重新输入"<<endl;break;
}
}
这个是其中的switch语句中的case,编译时出现如下错误
Compiling...
Fuzhuang main.cpp
c:\documents and settings\administrator\桌面\服装管理系统\fuzhuang management 最全修改,可以保存 - 副本\fuzhuang main.cpp(44) : error C2676: binary '||' : 'class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >' does
not define this operator or a conversion to a type acceptable to the predefined operator
c:\documents and settings\administrator\桌面\服装管理系统\fuzhuang management 最全修改,可以保存 - 副本\fuzhuang main.cpp(44) : fatal error C1903: unable to recover from previous error(s); stopping compilation
执行 cl.exe 时出错.
Fuzhuang main.obj - 1 error(s), 0 warning(s)
求各位帮我指出错误,谢谢了! 展开
cout<<"请输入要修改信息的服装编号"<<endl;
int num;
int price;
string size("S"),sex;
cin>>num;
while(num%1000>i)
{
cout<<"未注册!!"<<endl;
cout<<"请重新输入:"<<endl;
cin>>num;
}
cout<<" ╭---------服装商店管理系统----------╮"<<endl;
cout<<" ∣ ∣"<<endl;
cout<<" ├-------------------------------------┤"<<endl;
cout<<" ∣ 1.请输入新的服装尺寸(S,M,L,XL,XLL)∣"<<endl;
cout<<" ";
while(!((size="S")||(size="M")||(size="XL")||(size="XXL")||(size="L")))
{
cin>>size;
switch(size)
{
case "S": t[num%1000-1].setsize (size);break;
case "M": t[num%1000-1].setsize (size);break;
case "L": t[num%1000-1].setsize (size);break;
case "XL": t[num%1000-1].setsize (size);break;
case "XXL": t[num%1000-1].setsize (size);break;
default:cout<<"您的输入有误,请重新输入"<<endl;break;
}
}
这个是其中的switch语句中的case,编译时出现如下错误
Compiling...
Fuzhuang main.cpp
c:\documents and settings\administrator\桌面\服装管理系统\fuzhuang management 最全修改,可以保存 - 副本\fuzhuang main.cpp(44) : error C2676: binary '||' : 'class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >' does
not define this operator or a conversion to a type acceptable to the predefined operator
c:\documents and settings\administrator\桌面\服装管理系统\fuzhuang management 最全修改,可以保存 - 副本\fuzhuang main.cpp(44) : fatal error C1903: unable to recover from previous error(s); stopping compilation
执行 cl.exe 时出错.
Fuzhuang main.obj - 1 error(s), 0 warning(s)
求各位帮我指出错误,谢谢了! 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询