"C++ 리스트"의 두 판 사이의 차이

(새 문서: ==개요== ;C++ list ;C++ 리스트 <source lang='cpp'> #include <iostream> #include <list> using namespace std; int main() { list<int> l = { 3, 1, 4, 8 }; for (int n : l) {...)
 
잔글 (봇: 자동으로 텍스트 교체 (-</source> +</syntaxhighlight>, -<source +<syntaxhighlight ))
 
(다른 사용자 한 명의 중간 판 3개는 보이지 않습니다)
2번째 줄: 2번째 줄:
;C++ list
;C++ list
;C++ 리스트
;C++ 리스트
<source lang='cpp'>
<syntaxhighlight lang='cpp'>
#include <iostream>
#include <iostream>
#include <list>
#include <list>
18번째 줄: 18번째 줄:
// 4
// 4
// 8
// 8
</source>
</syntaxhighlight>
<syntaxhighlight lang='cpp'>
#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
</syntaxhighlight>


==같이 보기==
==같이 보기==
* [[C++ 벡터]]
* [[C++]]
* [[C++]]
* [[리스트]]
* [[리스트]]

2020년 11월 2일 (월) 02:47 기준 최신판

1 개요[ | ]

C++ list
C++ 리스트
#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
#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 참고[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}