title: C hard coding an array of typedef struct
body: <p>This is such a dumb question it's frustrating even asking it. Please, bear with me, I'm feeling particularly dumb over this one today....  </p>
  
  <p>I've got a library with a certain typedef struct. basically: </p>
  
  <pre><code>typedef struct {int x; int y;} coords;
  </code></pre>
  
  <p>What I really wanted to do was declare in my header a variable array of this: </p>
  
  <pre><code>coords MyCoords[];
  </code></pre>
  
  <p>(I recently switched it to just <code>coords *MyCoords;</code> and then ran a <code>MyCoords = new coords[4];</code>) </p>
  
  <p>and then in my init I wanted to hardcode some values in it. </p>
  
  <pre><code>MyCoords[] = {{0, 0}, {2, 2} etc. 
  </code></pre>
  
  <p>I must just be brainfarting today because it's not letting me do any manner of simply putting in even something simple like <code>MyCoords[0] = {0, 0}</code></p>
  
  <p>sorry about some of the syntax above. Thanks for any help. I don't even care about hard-coding all the values at once. I'm now fine with just geting <code>MyCoords[0] = {0, 0}</code> working. I could do <code>MyCoords[0].x = 0; MyCoords[0].y = 0</code> but then I'd never figure out what I'm doing wrong. Thanks a lot anyone..</p>