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...

The Theme Fonts group of formatting choices for a document theme contains a set of lines and fill effects.

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

Computer Science & Information Technology

Find the error(s) in each of the following. When possible, explain how to correct each error.

a) ``` namespace Name { int x; int y; mutable int z; }; ``` b) ``` int integer = const_cast< int >( double ); ``` c) ``` namespace PCM( 111, "hello" ); // construct namespace ```

Computer Science & Information Technology

If a Windows administrator wanted to control which users can access the Windows Store, which tool would he use?

What will be an ideal response?

Computer Science & Information Technology

Key loggers can be only software-based

Indicate whether the statement is true or false.

Computer Science & Information Technology