본문 바로가기
PROGRAMING📚/자료구조📑

STL_템플릿 _list사용하여 출력

Ta이니 2021. 4. 3.
728x90
반응형

#include<iostream>

#include<list>

using namespace std; 

 

 

void main() {

   list<int>myList;

   myList.push_back(50);

   myList.push_front(300);

   myList.push_back(200);

   myList.push_back(150);

   list<int>::iterator iter = myList.begin();

   

   while (iter != myList.end()) {

      int out = *iter;

      cout << out << endl;

      iter++;

   }

 

}

//삭제시. data.erase(iter);

delet iter->first;

728x90
반응형

댓글