列表模板

#include<iostream>
#include<list>
#include<stack>
using namespace std;

class Student{

};

//列表模板
void main(){
	list<int>mylist;
	list<Student>youlist;
	for(int i = 1;i <= 10; ++i){
		mylist.push_back(i);
	}
	list<int>::iterator it = mylist.begin();
	while(it != mylist.end()){
		cout<<*it<<"-->";
		++it;
	}
	cout<<"Nul."<<endl;
}

版权声明:本文为博主原创文章,如有错误,恳请大家在评论区指出,在下不胜感激~如要转载注明出处即可~