Notice
Recent Posts
Recent Comments
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
Tags
- C언어
- vector
- LineTracer
- Stack
- Visual Micro
- stl
- 수광 소자
- directx
- 아두이노
- 아두이노 컴파일러
- 컴퓨터 그래픽스
- set
- WinAPI
- map
- 자료구조
- queue
- 시스템프로그래밍
- 아두이노 소스
- Deque
- Array
- 통계학
- Arduino
- 라인트레이서
- html
- priority_queue
- c++
- Algorithm
- arduino compiler
- 운영체제
- list
Archives
- Today
- Total
Kim's Programming
Map - crbegin() 본문
소스)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | #include<iostream> #include<string> #include<map> void print(std::map<int, std::string> Target_Map) { for (std::map<int, std::string>::iterator IterPos = Target_Map.begin(); IterPos != Target_Map.end(); ++IterPos) std::cout << "Key->" << IterPos->first << ", Value->" << IterPos->second << " "; std::cout << std::endl; } void print(std::pair<int, std::string> Target_Pair) { std::cout << Target_Pair.first << " " << Target_Pair.second << std::endl; } void main() { std::map<int, std::string> Map; Map[1] = "First"; Map[2] = "Second"; Map[3] = "Third"; Map[4] = "Fourth"; print(Map); print(*Map.crbegin()); print(Map); } | cs |
내용)
crbegin()함수는 거꾸로 본 map에서 가장 앞에 있는 요소를 리턴합니다.
결과)
'STL - Container > Container - Map' 카테고리의 다른 글
Map - emplace() (0) | 2016.02.01 |
---|---|
Map - crend() (0) | 2016.02.01 |
Map - count() (0) | 2016.02.01 |
Map - Clear() (0) | 2016.02.01 |
Map - cend() (0) | 2016.02.01 |