[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 261
  • Last Modified:

Vector(STL)

I'd like to know how I can erase the i-th element in vector? I did not find existing API doing this.
0
Embt
Asked:
Embt
1 Solution
 
nietodCommented:
You can use the erase() member, like

vector<int> V;
int i = ??; // index of item you want to delete.

V.erase(v.begin() + i);

let me know if you have any questions.
0

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now