Skip to content

Instantly share code, notes, and snippets.

Created June 4, 2013 06:52
Show Gist options
  • Save anonymous/5704080 to your computer and use it in GitHub Desktop.
Save anonymous/5704080 to your computer and use it in GitHub Desktop.
#include <iostream>
#include <vector>
#include <iterator>
typedef std::vector<int> int_vector;
typedef std::vector<int>::iterator int_vector_iterator;
int main(){
int_vector myVec;
int_vector_iterator it;
for (int i = 0; i < 5; ++i){
myVec.push_back(2 * i);
}
std::cout << "Some even numbers: " << std::endl;
for (it = myVec.begin(); it != myVec.end(); ++it){
std::cout << *it << std::endl;
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment