Answer the following statements true (T) or false (F)
1. The model for the iterator in the STL was the pointer.
2. The Standard Template Library consists of the containers of various kinds.
3. The STL containers each define iterators appropriate to the internal structure of the container.
4. The operator * is prefixed to an iterator to insert an element in the container.
5. 5. 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
```
1. True
For the most powerful iterator, the random access iterator, the behavior is identical to that of a pointer. Less powerful iterators omit some of the behavior of pointers.
2. False
Besides the various kinds of containers, there are generic algorithms and iterators that allow generic algorithms to manipulate data in the containers.
3. True
The vector has random access iterators that act like pointers (mostly because they are pointers.) The list container (which is a doubly linked list) has iterators that are class objects that overload ++ and -- to get the behavior needed.
4. False
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.
5. True
The std:: makes the name vector available from namespace std, the
You might also like to view...
Charlotte is learning about fair use of copyrighted material. Charlotte learns that taking audio tracks from a CD and converting them into MP3 format is called ____ shifting.
A. shape B. time C. place D. format
The TDMA and ________ methods allow a mobile phone system to transmit approximately ten times as many calls on the same set of frequencies as the first generation analog system
A) DSP B) CDMA C) FSK D) AMPS
A(n) ________ displays when you start PowerPoint
Fill in the blank(s) with correct word
This device enables connectivity between two LANS or a LAN and a larger network.
A. router B. node C. hub D. network gateway