The programs runs and displays the result it's supposed to. But then a different pop up from microsft's visual c++ 2010 comes up. I have attached an image as well.
Source code
// This program provides a simple iterator demonstration.
#include <iostream>
#include <vector> // Include the vector header
using namespace std;
int main()
{
int count; // Loop counter
// Define a vector object.
vector<int> vect;
// Define an iterator object.
vector<int>::iterator iter;
// Use push back to push values into the vector.
for (count = 0; count < 10; count++)
vect.push_back(count); //vect.push_back(count+1); will do 1 to 19, rather than 0 to 9
// Step the iterator through the vector, and use
// it to display the vector's contents.
cout << "Here are the values in vect: ";
for (iter = vect.begin(); iter < vect.end(); iter++)
{
cout << *iter << " ";
}
// Step the iterator through the vector backwards.
cout << "\nand here they are backwards: ";
for (iter = vect.end() - 1; iter >= vect.begin(); iter--)
{
cout << *iter << " ";
}
cout << endl;
system("pause");
return 0;
}
Attached image(s)
This post has been edited by mgrex: 06 March 2012 - 05:37 PM

New Topic/Question
Reply



MultiQuote



|