| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1160 人关注过本帖
标题:vector::const_iterator
只看楼主 加入收藏
独孤剑魔
Rank: 1
等 级:新手上路
帖 子:103
专家分:0
注 册:2008-8-5
收藏
 问题点数:0 回复次数:2 
vector::const_iterator
#include<iostream>
#include<vector>
using namespace std;
void main()
{
    vector<string> text(10,"abc");
    for(vector<string>::const_iterator iter = text.begin();iter!=text.end();iter++)
    {
        cout<<*iter<<endl;
    }
}

编译无法通过
--------------------Configuration: fafafad - Win32 Debug--------------------
Compiling...
fafa.cpp
D:\c++\fafafad\fafa.cpp(9) : error C2679: binary '<<' : no operator defined which takes a right-hand operand of type 'const class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >' (or there is no acceptable conv
ersion)
Error executing cl.exe.

fafafad.exe - 1 error(s), 0 warning(s)
搜索更多相关主题的帖子: vector const iterator text std 
2008-08-09 10:21
xlh5225
Rank: 2
等 级:论坛游民
威 望:2
帖 子:188
专家分:25
注 册:2007-8-14
收藏
得分:0 
加一个头文件:#include<string>
2008-08-09 10:25
独孤剑魔
Rank: 1
等 级:新手上路
帖 子:103
专家分:0
注 册:2008-8-5
收藏
得分:0 
感谢!
2008-08-09 10:26
快速回复:vector::const_iterator
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.015793 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved