在dev-CPP 器中居然不识别 ostream_iterator

lonelyforest 2005-05-18 02:42:58
本人写的一个小程序,其中有这么一段
#include <ostream>

//......................
ostream_iterator<string>.....
编译器死活不认识.........郁闷啊!
...全文
143 4 打赏 收藏 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
lonelyforest 2005-05-19
  • 打赏
  • 举报
回复
我搞不明白, 但是在VC6.0 里却完全正常!!
我用的是dev-CPP 4.9.9.2
guyaguya 2005-05-18
  • 打赏
  • 举报
回复
怎么可能
list<int>coll;
list<int>::iterator it;
for(int i = 1;i<=6;++i)
{
coll.push_front(i);
coll.push_back(i);
}

cout<<"pre: "<<endl;
copy(coll.begin(),coll.end(),ostream_iterator<int>(cout," "));
可以的
ostream_iterator<string>应该一样的
whyglinux 2005-05-18
  • 打赏
  • 举报
回复
#include <iostream>
#include <iterator>
#include <string>
using namespace std;
whyglinux 2005-05-18
  • 打赏
  • 举报
回复
#include <iostream>
#include <iterator>

3,881

社区成员

发帖
与我相关
我的任务
社区描述
C/C++ 其它技术问题
社区管理员
  • 其它技术问题社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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