Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#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
You can’t perform that action at this time.