title: Initializing an array of struct in one line? (in C)
body: <p>I have a 2d array of structs like this,</p>
  
  <pre><code>MapStruct myMap[50][50];
  </code></pre>
  
  <p>So we can initialize like this,</p>
  
  <pre><code>myMap[0][0].left = 0;
  myMap[0][0].up = 1;
  myMap[0][0].right = 5;
  </code></pre>
  
  <p>I know that I can also use the below example,</p>
  
  <pre><code>MapStruct myMap[50][50] = { {0,1,5}, {2,3,7}, {9,11,8} ... };
  </code></pre>
  
  <p>But the problem is that there are significant empty spots in this 50x50 structure. So for example maybe from [30][40] up to [40][50] is empty
  and some other points here and there are empty so with the above bracket notation i have to leave empty brackets like this {},{},{} for those empty spots.</p>
  
  <p>Now my question is is there a way to initialize the like below?</p>
  
  <pre><code>myMap[0][0] = {0, 1, 5}; // gives a syntax error
  </code></pre>
  
  <p>Saves two lines per point I'd be pretty happy with that.</p>
  
  <p>Ps: I'm using the indices myMap[x][y] as keys like a dictionary object so I can't just get rid of those empty ones in the middle because that changes the indices.</p>