title: Can a two-dimensional array in C be initialized without explicit size?
body: <p>I have a question regarding two-dimensional arrays in C. I know now (from direct compiler experience) that I can't initialize such an array analogously to one-dimensional arrays like this:</p>
  
  <pre><code>int multi_array[][] = {
    {1,2,3,4,5},
    {10,20,30,40,50},
    {100,200,300,400,500}
  };
  
  &gt; compiler output:
  
  gcc -o arrays arrays.c
  arrays.c: In function ‘main’:
  arrays.c:8:9: error: array type has incomplete element type
  </code></pre>
  
  <p>The closest solution that works is to provide the number of columns explicitly like this:</p>
  
  <pre><code>int multi_array[][5] = {
    {1,2,3,4,5},
    {10,20,30,40,50},
    {100,200,300,400,500}
  };
  </code></pre>
  
  <p>My question is: can it be done neatly <em>without</em> supplying the number explicitly (which after all the compiler should be able to infer itself)? I'm not talking about manually constructing it with <code>malloc</code> or something but rather something close to what I tried.
  Also, can someone knowledgeable about C compilers explain from a low-level perspective why my initial attempt does not work?</p>
  
  <p>I used plain <code>gcc</code> with no non-standard options to compile the code.</p>
  
  <p>Thanks</p>