1 개요[ | ]
- C++ list
- C++ 리스트
C++
Copy
#include <iostream>
#include <list>
using namespace std;
int main() {
list<int> l = { 3, 1, 4, 8 };
for (int n : l) {
std::cout << n << '\n';
}
}
// 3
// 1
// 4
// 8
C++
Copy
#include <iostream>
#include <list>
using namespace std;
int main() {
list<int> l = { 3, 1, 4, 8 };
l.push_front(5);
l.push_back(6);
for (int n : l) {
std::cout << n << '\n';
}
}
// 5
// 3
// 1
// 4
// 8
// 6
2 같이 보기[ | ]
3 참고[ | ]
편집자 Jmnote Jmnote bot
로그인하시면 댓글을 쓸 수 있습니다.