title: Declaring int array inside struct
body: <p>In C, I have defined the <code>struct</code> seen below, and would like to initialize it inline. Neither the fields inside the struct, nor the array <code>foos</code> will change after initialization. The code in the first block works fine.</p>
  
  <pre><code>struct Foo {
    int bar;
    int *some_array;
  };
  
  typedef struct Foo Foo;
  
  int tmp[] = {11, 22, 33};
  struct Foo foos[] = { {123, tmp} };
  </code></pre>
  
  <p>However, I don't really need the <code>tmp</code> field. In fact, it will just clutter my code (this example is somewhat simplified). So, instead I'd like to declare the values of <code>some_array</code> inside the declaration for <code>foos</code>. I cannot get the right syntax, though. Maybe the field <code>some_array</code> should be defined differently?</p>
  
  <pre><code>int tmp[] = {11, 22, 33};
  struct Foo foos[] = {
    {123, tmp},                    // works
    {222, {11, 22, 33}},           // doesn't compile
    {222, new int[]{11, 22, 33}},  // doesn't compile
    {222, (int*){11, 22, 33}},     // doesn't compile
    {222, (int[]){11, 22, 33}},    // compiles, wrong values in array
  };
  </code></pre>