C++ STL 双向链表容器

来源:互联网 发布:spring cloud node 编辑:程序博客网 时间:2024/05/22 12:23
// 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; 
}

原创粉丝点击