| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1704 人关注过本帖
标题:list如何进行数据输出的呢
只看楼主 加入收藏
newCpp
Rank: 5Rank: 5
来 自:火星
等 级:职业侠客
威 望:3
帖 子:256
专家分:375
注 册:2009-8-17
结帖率:97.83%
收藏
 问题点数:0 回复次数:0 
list如何进行数据输出的呢
list<int> the_list;
list<int>::iterator the;  
  
for( int ii = 0; ii < 10; ii++ )

{
the_list.push_back( ii );   
}
for (the=the_list.begin();the!=the_list.end();the++) //标准库输出的方式
{
cout << *the<< endl;
}
the=the_list.begin();
the++;
cout <<*the<< endl;
让the++;地址自加太麻烦了!
不知道有没有什么快捷点儿的方法!例如我现在想让the输出the_list里第5个数据元素的值
该如何才能够做到的呢?
搜索更多相关主题的帖子: list 数据 输出 
2010-05-17 18:57
快速回复:list如何进行数据输出的呢
数据加载中...
 
   



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

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