STL中的動態數組類

std::vector的特點 在數組末尾添加元素所需要的時間是固定的 在數組中間添加或是刪除元素所需的時間和該元素後面的元素個數成正比 存儲的元素數是動態的,而vector類負責內存管理 典型的vector操作 實例化vector #include <vector> int main () { // vector of integers std::vector<int> intege
相關文章
相關標籤/搜索