title: Creating an array of two-dimensional arrays in C#
body: <p>I simply want to create an array of two dimensional arrays to store coordinate points.</p>
  
  <p>So I want an array where each index returns a two dimensional array which I would use as <code>x</code> and <code>y</code>.</p>
  
  <p>Here's what I've tried:</p>
  
  <pre><code>waypoints = new int[4][,]    {
          {{0},{6, 0}},
          {{1},{1, 1}},
          {{2},{1, 5}},
          {{3},{6, 5}}
      };
  </code></pre>
  
  <p>I realize this probably looks stupid, but I've tried looking it up on Google, and I have not gotten any good results.</p>
  
  <p>It gives an error:</p>
  
  <blockquote>
    <p>"error CS0623: Array initializers can only be used in a variable or
    field initializer. Try using a new expression instead "</p>
  </blockquote>
  
  <p>I also tried doing it like this:</p>
  
  <pre><code>waypoints = new int[4][,] {
          new int[,] {6, 0},
          new int[,] {1, 1},
          new int[,] {1, 5},
          new int[,] {6, 5}
          };
  </code></pre>
  
  <p>This gives an error:</p>
  
  <blockquote>
    <p>"error CS0846: A nested array initializer was expected"</p>
  </blockquote>