help tracing a vector

Help tracing a vector

1
2
3
4
5
6
7
8
9
10
11
12
 
Show the values in each vector after the following statements:
int intArr[] = {2, 5, 11, 9, 25};
vector<int> vA(3,1), vB(5), vC(intArr, intArr+4); 

vA.push_back(2);
vB.resize(3);
vC.pop_back();

(a) vA = 
(b) vB = 
(c) vC =

vA.push_back(2); = [adding 2 to the end that would give us 1 1 1 2

vB.resize(3); = resize the vector to 3 elements so 0 0 0

vC. pop_back(); i don't understand
Last edited on
Topic archived. No new replies allowed.