Skip to content

Instantly share code, notes, and snippets.

@Ben1980
Last active November 9, 2019 12:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Ben1980/d10fe2196b8d1aa08d0793c96defb64c to your computer and use it in GitHub Desktop.
Save Ben1980/d10fe2196b8d1aa08d0793c96defb64c to your computer and use it in GitHub Desktop.
#include <iostream>
#include <vector>
void print(const std::vector<int> &vec) {
std::cout << "sizeof(int): " << sizeof(int) << ' ';
for(const auto & e : vec) {
std::cout << &(e) << ", ";
}
std::cout << std::endl;
}
int main() {
std::vector<int> vec = { 0,1,2,3,4,5,6,7,8,9,10 };
print(vec);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment