您的位置:首页 > 编程语言 > C语言/C++

C++ STL 双向链表容器

2013-10-23 10:26 169 查看
// 1233.cpp : Defines the entry point for the console application.

//

#include "stdafx.h"

#include <list>

using namespace std;

int main(int argc, char* argv[])

{
//声明链表
list<int>alist;
alist.push_back(5);
alist.push_back(6);
alist.push_back(3);
alist.push_back(1);

//声明迭代器
list<int>::iterator p;
for(p=alist.begin();p!=alist.end();p++)
{
printf("%d ",*p);
}

printf("\n");
printf("%d",sizeof(alist.front()));
return 0; 

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  迭代器 链表