Assume proper includes have been executed, but not using directive or declaration. Write a definition of an iterator for a vector named vec of int values. Write a for loop that will display the contents vec on the screen, separated by spaces starting at the last element in the vector and proceeding to the first. Use iterators for the loop control.
What will be an ideal response?
```
#include
#include
using std::vector;
using std::cout;
using std::endl;
int main()
{
std::vector
std::vector
for(int i=0; i<10; i++)
vec.push_back(i);
for (itr = vec.rbegin(); itr != vec.rend(); itr++)
cout << *itr << " ";
cout << endl;
return 0;
}
```
You might also like to view...
All server-level principals have access to the SQL databases.
Answer the following statement true (T) or false (F)
Describe the role of the new InPrivate browsing feature in Microsoft's Edge browser.
What will be an ideal response?
Database programs must load an entire database file into RAM for it to function
Indicate whether the statement is true or false
David has written a long report on physical therapy best practices that includes a number of headings. He needs to display the document so he can easily glance over one or multiple pages at a time, in order to view the design and layout of the document. Describe one Word feature which would allow him to do so. David also needs an easy way to view and reorganize the headings and text in his report. Which Word view would he use to do so?
What will be an ideal response?