일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
29 | 30 | 31 |
- 문학
- 신혼여행
- HONEYMOON
- Programming
- 영화
- 포인터
- C/C++
- 프로그래밍
- 사랑
- English
- 사진
- 책
- radar
- english presentation
- 영어
- poetry
- english essay
- 시
- Android
- 필리핀
- 안드로이드
- 함수포인터
- STL
- network
- 돈
- 회계
- java
- Joe Satriani
- generic algorithm
- 보라카이
- Today
- 36
- Total
- 807,509
목록STL (8)
Humaneer.net
부동 소수점(float, double) 타잎의 배열이나 stl 컨테이너의 값을 sum할 때 유의사항. 루프를 돌면서 배열의 값을 다 더하는 것과 std::accumulate 의 결과가 다를경우가 발생할 수 있다. 아래 링크를 통해 결과 확인이 가능하다.https://ideone.com/oBJVX8 이것 때문에 디버깅 하느라 꽤나 애먹었음. -_-; 그 이유는 accumulate의 3번째 인자인 init value의 형(type) 때문.http://stackoverflow.com/questions/3604478/c-stdaccumulate-doesnt-give-the-expected-sum template을 이용한 코딩을 할 때는 3번째 인자인 init value에 0을 T로 타잎 캐스팅 하면 됨. sta..
pgr을 돌아다니다가, 아래의 글을 발견하였다. http://www.pgr21.com/zboard4/zboard.php?id=bug&page=1&sn1=&divpage=11&sn=off&ss=on&sc=on&select_arrange=headnum&desc=asc&no=60132 질문자가 남긴 코드는 다음과 같다. #include #include #include #include using namespace std; void main(void) { int iv[10] = {1,2,3,4,5,6,7,5,4,12}; vectorvec(iv,iv+5); vectornvec; vector::iterator iter=vec.begin(); const int val=5; while((iter=find_if(iter,..
#include #include #include #include #include using namespace std; template class calc_square { T i; public : calc_square() : i(0) {} T operator() () { ++i; return i * i;} }; int main() { cout
#include #include #include #include #include using namespace std; void print_list(string s) { cout
종류 클래스 헤더 파일 컨테이너 클래스(container classes) vector vector list list deque deque set, multiset set map, multimap map hash_set, hash_multiset hash_set hash_map, hash_multimap hash_map 컨테이너 어댑터(container adaptors) stack stack queue, priority_queue queue 제네릭 알고리듬(generic algorithms) 아래 다섯 개를 제외한 모든 알고리듬 algorithm 범용 수치 알고리듬(generalized numeric algorithms) iota, accumulate, inner_product, adjacent_diffe..
#include #include #include #include using namespace std; int main() { cout