ITECC03 Flashcards
1
Q
How do you remove the last element from a vector in C++?
A
vector.pop_back()
2
Q
Which method is used to clear all elements from a vector in C++?
A
vector.clear()
3
Q
How to get the size of a vector in c++?
A
vector.size();
4
Q
What is the function used to remove the first occurrence of a specific element from a vector?
A
erase()
5
Q
What is the function used to find the first occurrence of a specific element from a vector?
A
find()
6
Q
Which method is used to swap the contents of two vectors in C++
A
swap()