What does the following statement do? vector<int> v(10, 2); It creates a vector
ID: 3554709 • Letter: W
Question
What does the following statement do?
vector<int> v(10, 2);
It creates a vector object with a starting size of 10 and the first element initialized with the value 2.
It creates a vector object with a starting size of 10 and all elements are initialized with the value 2.
It creates a vector object and initializes all the first two elements with the values 10 and 2.
It creates a vector object with a starting size of 2 and the first element initialized with the value 10.
It creates a vector object with a starting size of 10 and the first element initialized with the value 2.
It creates a vector object with a starting size of 10 and all elements are initialized with the value 2.
It creates a vector object and initializes all the first two elements with the values 10 and 2.
It creates a vector object with a starting size of 2 and the first element initialized with the value 10.
Explanation / Answer
It creates a vector object with a starting size of 10 and all elements are initialized with the value 2.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.