In a vector, which of the following statements is true?

a. Indexing vector access is range checked.
b. The range of legal index values for a vector is 0 to the value of v.size()-1
c. To add a value use the member function v.push_front( )
d. To manage size of reserve use v.reserve(newReserve)
e. To increase or decrease a vector’s size v.new_size(newSize);


b) and d) are correct
Explanation: a) indexing is not range checked.
b) index values run from 0 to one less than the number of elements
c) use v.push_back( ) to add elements at the back. The mentioned function is not available on the vector. In e) to increase or decrease a vector, use v.resize(newSize);

Computer Science & Information Technology

You might also like to view...

A statement that displays the address of the variable num1 is

A) cout << num1;. B) cout << *num1;. C) cout << &(*num1);. D) cout << &num1;. E) None of the above

Computer Science & Information Technology

All WiFi hotspots are available free

Indicate whether the statement is true or false

Computer Science & Information Technology

Ajax separates the user interaction portion of an application from its server interaction, enabling both to proceed ________.

a. synchronously. b. asynchronously in parallel. c. without any interaction whatsoever. d. None of the above.

Computer Science & Information Technology

Which of the following is the best tool for analyzing employee performance over a period of time?

A) Data table B) Outline C) PivotTable D) Subtotals

Computer Science & Information Technology