What does the following statement do? vector<int> v(10, 2) ;
A) It creates a vector object and initializes all the first two elements with the values 10 and 2.
B) It creates a vector object with a starting size of 2 and the first element initialized with the value 10.
C) It creates a vector object with a starting size of 10 and the first element initialized with the value 2.
D) It creates a vector object with a starting size of 10 and all elements are initialized with the value 2.
Correct Answer:
Verified
Q15: An array can easily be stepped through
Q18: Given the following declaration, where is 77
Q20: An array's size declarator must be a(n)_
Q21: An array with no elements is _.
A)legal
Q24: What will the following code do?
Q29: To pass an array as an argument
Q35: A two-dimensional array can have elements of
Q38: It is _ to pass an argument
Q45: This vector function removes an item from
Q47: Which statement correctly defines a vector object
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents