Vector.erase(Vector.begin() + 下標);
例如:
vector<int> v;
v.erase(v.begiin()+5);
則刪除容器中下標爲5的元素。
小記—— vector 刪除指定下標中的元素(不使用迭代器(iterator ))
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章
乾貨總結:如何系統地學習 C++ 語言?
古老的屋檐下
2020-07-02 14:12:11
Qt——應用程序打包(二)
FadeFarAway
2020-06-27 20:18:18
Qt——應用程序打包(一)
FadeFarAway
2020-06-27 20:18:04
Qt——QString 和std::string互轉
FadeFarAway
2020-06-27 20:18:04
Qt——常量中有換行符
FadeFarAway
2020-06-27 20:18:04
第一章 從C到C++的一些變化 總結
路哞哞
2020-06-20 13:02:51
sizeof和strlen函數區別
Carey_Lu
2020-06-16 12:05:58
180111—【字符】字符變量、字符數組以及它和指針亂七八糟的關係。
DRondong
2020-06-16 04:45:57
C++之template
Michael_峰
2020-05-31 08:51:31
第五章 C++多態(Polymorphism)與虛函數(Virtual Function)
路哞哞
2020-03-03 05:30:28
C中的Flout和0的比較
aap159951
2020-02-22 01:30:27