title: Cannot increment integer inside the foreach loop
body: <p>I have a C# method to convert from a list into an array. The code goes like this:</p>
  
  <pre><code>public String[] ConvertToArray(List&lt;InstallationControl&gt; list)
          {
              String[] Array = null;
              Int32 i = 0;
              foreach (var item in list)
              {
                  Array[i] = item.Value.ToString();
                  i++;
              }
  
              return Array;
          }
  </code></pre>
  
  <p>However, it's always giving me the Null exception. Can someone explain this to me? </p>