Chinaunix首页 | 论坛 | 博客
  • 博客访问: 88269
  • 博文数量: 34
  • 博客积分: 2000
  • 博客等级: 大尉
  • 技术积分: 395
  • 用 户 组: 普通用户
  • 注册时间: 2009-03-23 10:22
文章分类

全部博文(34)

文章存档

2011年(1)

2010年(4)

2009年(29)

我的朋友

分类: C/C++

2009-05-07 17:26:20

#include "stdafx.h"
#include
#include
#include
using namespace std;
//函数copy和ostream迭代器
int main()
{
 int intArray[]={5,6,8,3,40,36,98,29,75};
 vector ivec(9);
 ostream_iterator screen(cout," ");
 //迭代器输出元素时,以空格分隔元素
 cout<<"intArray:"< copy(intArray,intArray+9,screen);
 cout<
 copy(intArray,intArray+9,ivec.begin ());
 cout<<"vecList:"< copy(ivec.begin (),ivec.end (),screen);
 cout<
}
阅读(831) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~