Answer the following statements true (T) or false (F)

1) An object of type iterator refers to a container element that can be modified.
2) We use const versions of the iterators for traversing read-only containers.
3) For input iterators and output iterators, it’s common to save the iterator then use the
saved value later.
4) Class templates array, vector and deque are based on built-in arrays
5) Attempting to dereference an iterator positioned outside its container is a compilation
error. In particular, the iterator returned by end should not be dereferenced or incremented.


1. True.
2. True.
3. False. For input and output iterators, it’s not possible to save the iterator then use the
saved value later.
4. True.
5. False. It’s a run-time logic error.

Computer Science & Information Technology

You might also like to view...

The ____ contains three different symbols: an oval, a parallelogram, and a rectangle.

A. pseudocode B. flowchart C. desk-check table D. specification

Computer Science & Information Technology

What does the following code print?

``` cout << "*\n**\n***\n****\n*****" << endl; ```

Computer Science & Information Technology

A(n) ____________________ is an object that produces each element of a container, such as a linked list, one element at a time.

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology

Which of the following devices would administer routing in a network?

A. Multilayer switch B. Proxy server C. DNS server D. Load balancer

Computer Science & Information Technology