title: How to initialize array of struct?
body: <p>Dysfunctional Example:</p>
  
  <pre><code>public struct MyStruct { public int i, j; }
  
  static readonly MyStruct [] myTable = new MyStruct [3] 
  {
      {0, 0}, {1, 1}, {2, 2}
  }
  </code></pre>
  
  <p>I know that this code doesn't work. Now how do I write this down please (proper syntax)?</p>
  
  <p>The thought behind this is the following. Afaik the elements of arrays of struct are value types, so myTable points to a memory location containing three MyStruct objects (and not to a memory location containing three (uninitialized) pointers to MyStruct objects).</p>
  
  <p>So how do I go about initializing those MyStruct objects, what would be the right syntax? I don't have to allocate them anymore, right?</p>