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

1. The operator * is prefixed to an iterator to insert an element in the container.

2. To declare an iterator, one must #include the proper header file, then specify the container type and use that with the scope resolution operator, ::, to qualify the inner type iterator, to declare the iterator variable, as in
#include
std::vector::iterator myIterator;.


1. False
Explanation: The * operator applied to an iterator makes the element in the container available for either fetching the value or overwriting an element already there. It does not insert anything into the container. There are insert adapter iterators that the text does not mention.
2. True
Explanation: The std:: makes the name vector available from namespace std, the is the template argument, this qualifies the inner type iterator to declare myIterator.

Computer Science & Information Technology

You might also like to view...

The __________, also known as the address operator, returns the memory address of a variable.

a. asterisk (* ) b. ampersand ( & ) c. percent sign ( % ) d. exclamation point ( ! ) e. None of these

Computer Science & Information Technology

Which of the following is true?

a. You should maintain a separate database connection for each client request. b. You should use a connection pool that allows the server to manage a limited number of database connections and share them among requests. c. You should never connect to databases from web apps. d. None of the above.

Computer Science & Information Technology

?Which of the following is the first step whilecreating a form based on two tables?

A. ?You should first choose the primary table and select the fields to include in the main form. B. ?You should first choose the primary table and select the fields to include in the subform. C. ?You should first choose the related table and select the fields to include in the main form. D. ?You should first choose the related table and select the fields to include in the subform.

Computer Science & Information Technology

Inkjet printers frequently have a built-in paper test to ensure the paper weight is enough to print the specified output, such as photos

Indicate whether the statement is true or false

Computer Science & Information Technology