下面这个代码出现invalid use of member (did you forget the `&' ?) 错误是什么意思啊

a530877647 2012-09-18 01:22:01
#include<iostream>
#include<vector>
#include<string>
#include<cctype>
using namespace std;
int main(){
vector<string> svec;
string str;
cout<<"Enter text(Ctrl+Z to end):"<<endl;
while(cin>>str)
svec.push_back(str);
if(svec.size()==0){
cout<<"no strings?"<<endl;
return -1;
}
cout<<"Transformed elements frome the vector:"
<<endl;

for(vector<string>::size_type ix=0;ix!=svec.size();++ix){
for(string::size_type index=0;index!=svec[ix].size;++index)\\错误在这一行
if(islower(svec[ix][index])
svec[ix][index]=toupper(svec[ix][index]);
cout<<svec(ix)<<" ";
if((ix+1)%8==0) cout<<endl;
}
system("pause");
return 0;
}
...全文
351 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
zhaoZero41 2012-09-18
  • 打赏
  • 举报
回复
for(string::size_type index=0;index!=svec[ix].size();++index)

33,311

社区成员

发帖
与我相关
我的任务
社区描述
C/C++ 新手乐园
社区管理员
  • 新手乐园社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧