Created
November 17, 2015 17:25
-
-
Save abatilo/6875b0be32c285a3790e to your computer and use it in GitHub Desktop.
C++ sample of using a vector with auto for an iterator
This file contains hidden or 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> | |
int main() { | |
std::vector<int> v {1, 2, 3}; | |
for (auto& i : v) { | |
std::cout << i; | |
} | |
std::cout << std::endl; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment