title: How to assign multiple constants to an array at once, not at the time of declaration?
body: <p>This is a C# newbie question.</p>
  
  <p>Consider the following array declaration and initialization:</p>
  
  <pre><code>// This declare the array and initialize it with the default values
  double[] MyArray = new double[3];
  </code></pre>
  
  <p>Somewhere in my code, I initialize the array as follows:</p>
  
  <pre><code>MyArray[0] = 1d;
  MyArray[1] = 2d;
  MyArray[2] = 3d;
  </code></pre>
  
  <p>I know that I can assign multiple constants at once to the array at the time of declaration as follows:</p>
  
  <pre><code>double[] MyArray = new double[3] {1d, 2d, 3d};
  </code></pre>
  
  <p>How to do such an initialization but not at the time of declaration in C#?</p>
  
  <p>In VB.NET, it can be done as follow:</p>
  
  <pre><code>Dim MyArray(3) As Double
  ...
  MyArray = {1#, 2#, 3#}  ' Assign multiple values at once
  </code></pre>
  
  <h2>Update</h2>
  
  <p>The reason why I want to separate between declaration and initialization is that the initialization will be inside a loop.</p>