Created
June 4, 2013 06:52
-
-
Save anonymous/5704080 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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