Quantcast
Channel: 보통프로그래머
Viewing all articles
Browse latest Browse all 118

STL : vector의 기본 특징과 방법(소스첨부)

$
0
0
Vector는 STL(Standard Template Library)의 list,deque 등과 함께 많이 쓰임,Vector는 삽입된 요소들 중 처음 또는 중간에서 요소를 삭제,삽입할경우 그 이후의 모든 요소들의 메모리 주소가 변화된다.이러한 특성은 시스템의 효율성을 떨어트릴 수 있으며 특성에 맞게 사용해야 하겠다.그러나 데이터 접근 및 메모리 접근 등이 매우 용이하여 많이 사용되고 있다.물론, 메모리의 할당은 공간이 모자랄 경우 비어 있는 공간을 알아서 확보해주고 사용하지 않을 때에는 알아서 삭제해주는 똑똑한 놈이다. #include <stdio.h> #include <time.h> #include <iostream> #include <vector> using namespace std; int main(vo.......

Viewing all articles
Browse latest Browse all 118


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>