Skip to content

Instantly share code, notes, and snippets.

@abatilo
Created November 17, 2015 17:25
Show Gist options
  • Save abatilo/6875b0be32c285a3790e to your computer and use it in GitHub Desktop.
Save abatilo/6875b0be32c285a3790e to your computer and use it in GitHub Desktop.
C++ sample of using a vector with auto for an iterator
#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