I can create an array and initialize it like this:
int a[] = {10, 20, 30};
How do I create a std::vector and initialize it similarly elegant?
The best way I know is:
std::vector<int> ints;
ints.push_back(10);
ints.…
I have a std::vector<int>, and I want to delete the n'th element. How do I do that?
std::vector<int> vec;
vec.push_back(6);
vec.push_back(-17);
vec.push_back(12);
vec.erase(???);
Assuming I have 2 standard vectors:
vector<int> a;
vector<int> b;
Let's also say the both have around 30 elements.
How do I add the vector b to the end of vector a?
The dirty way would …