Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想将一个元素推到向量中的第二位(omnet++),如果向量已满,我想删除最近的元素,有什么功能可以完成这项工作吗?
对于插入:
vector<int> myvector; myvector.insert ( myvector.begin() + 1 , 100 );
检查:
if (myvector.size() == SIZE) { myvector.pop_back(); }
希望能帮助到你。