Rewrite the code below using the ranged for loop and the auto keyword.

```
map personIDs = {
{1,"Walt"},
{2,"Kenrick"}
};
map::const_iterator iter;
for (iter = personIDs.begin(); iter != personIDs.end();
iter++)
{
cout << iter->first << " " << iter->second << endl;
}
```

The auto keyword makes it easier to iterate over a collection.
```
for (auto p : personIDs)
{
cout << p.first << " " << p.second << endl;
}
```

Computer Science & Information Technology

You might also like to view...

Typically, in hierarchical database management systems, a one-to-one relationship exists between data entities.

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

Computer Science & Information Technology

____ layers are a form of nondestructive editing because they do not alter the pixels on the layer or layers beneath them.

a. Fill b. Shape c. Temporary d. Central

Computer Science & Information Technology