I'm working on a program and I came across with a weird problem. I created a struct with a string and an int. Then I made a vector with the type struct.
1 2 3 4 5 6 7
struct X{
string a;
int b;
}
vector<X> v;
//add some values
I added some values and I did what I want. But when I try to erase the last n element, I get runtime error. How can I do properly?