【在vector中,怎样删除某个指定值的元素】
Vectors provide no operation to remove elements directly that have a certain value. You must use an algorithm to do this.
一.删除所有满足条件的元素
For example, the following statement removes all elements that have the value val:
For example, the following statement removes all elements that have the value val:
二.只删除第一个
To remove only the first element that has a certain value, you must use the following statements:
To remove only the first element that has a certain value, you must use the following statements: