error C2664: 'islower' : cannot convert parameter 1 from 'class std::basic_string<
intmain(){vector<string>svec;stringstr;cout<<"enterelementsinvector(pressCTRL+Ztoend)...
int main(){
vector<string> svec;
string str;
cout<<"enter elements in vector(press CTRL+Z to end)"<<endl;while(cin>>str)
{
svec.push_back(str);
cout<<"new elements push in"<<endl;
}
for(vector<string>::size_type i=0,j=svec.size();i<j;i++){
if(islower(svec[i]))
{
svec[i]=toupper(svec[i]);
}
}
for(vector<string>::size_type i=0,j=svec.size();i<j;i++){
cout<<svec[i];
}
return 0;
}
提示错误:error C2664: 'islower' : cannot convert parameter 1 from 'class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >' to 'int'
具体啥意思
我vector是string 怎么回事呢? 展开
vector<string> svec;
string str;
cout<<"enter elements in vector(press CTRL+Z to end)"<<endl;while(cin>>str)
{
svec.push_back(str);
cout<<"new elements push in"<<endl;
}
for(vector<string>::size_type i=0,j=svec.size();i<j;i++){
if(islower(svec[i]))
{
svec[i]=toupper(svec[i]);
}
}
for(vector<string>::size_type i=0,j=svec.size();i<j;i++){
cout<<svec[i];
}
return 0;
}
提示错误:error C2664: 'islower' : cannot convert parameter 1 from 'class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >' to 'int'
具体啥意思
我vector是string 怎么回事呢? 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询