Skip to content

Instantly share code, notes, and snippets.

@croepha
Created January 17, 2019 00:11
Show Gist options
  • Save croepha/7482267e0ed69c213b4c99b87746d7d3 to your computer and use it in GitHub Desktop.
Save croepha/7482267e0ed69c213b4c99b87746d7d3 to your computer and use it in GitHub Desktop.
#include <stdio.h>
#include <vector>
struct Thing {
int v1;
int v2;
};
int main () {
std::vector<Thing> things;
for(int i =0; i<5;i++) {
things.push_back(Thing{(i+1)*111,(i+1)*11111});
}
for(auto&thing:things) {
printf("thing: %d, %d\n", thing.v1, thing.v2);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment