fork download
  1. #include <iostream>
  2. #include <vector>
  3.  
  4. int main()
  5. {
  6. struct example_structure
  7. {
  8. int thing_one;
  9. int thing_two;
  10. };
  11.  
  12. std::vector<example_structure> data;
  13. for (int i = 0; i < 3; i++)
  14. {
  15. data.push_back({i, i * 2});
  16. }
  17.  
  18. for (const auto& x : data)
  19. {
  20. std::cout << x.thing_one << " " << x.thing_two << "\n";
  21. }
  22. }
  23.  
Success #stdin #stdout 0s 3272KB
stdin
Standard input is empty
stdout
0 0
1 2
2 4