STL Vector remove()和erase()的使用

STL中remove()只是將待刪除元素以後的元素移動到vector的前端,而不是刪除。若要真正移除,須要搭配使用erase()。 例子以下: 前端 #include <iostream> #include <vector> #include <algorithm> #include <functional> using namespace std; int main() { vector<
相關文章
相關標籤/搜索