ITPub博客

首页 > > > c++ list_iterator demo

c++ list_iterator demo

作者:友哥 时间:2018-08-08 17:36:00 0 删除 编辑
#include <iostream>
#include <list>
using namespace std;

typedef list<int> IntegerList;
int main()
{
    IntegerList    intList;
    for (int i = 1; i <= 10; ++i)
       intList.push_back(i * 2);
    for (IntegerList::const_iterator ci = intList.begin(); ci != intList.end(); ++ci)
       cout << *ci << " " << endl;
    return 0;
}

 遍历器对各种运算符进行重载  

原文作者:;如有侵权,请联系管理员删除。

请登录后发表评论 登录
全部评论

注册时间:2020-05-20

  • 博文量
    276
  • 访问量
    1000