0
点赞
收藏
分享

微信扫一扫

C++ STL 双向链表容器

// 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;

}

举报

相关推荐

0 条评论