1234
struct my_struct{ int x; .... };
struct s { int a,b; }
1234567
s arr[3]; arr[0].a=1; arr[0].b=1; arr[1].a=2; arr[0].b=1; arr[2].a=3; arr[0].b=1;
12345678910
#include <vector> int main() { struct S { S( int a, int b ) : a(a), b(b) {} int a, b ; } ; std::vector<S> seq ; for( int a : { 1, 2, 3 } ) for( int b : { 4, 5 } ) seq.emplace_back( a, b ) ; }