title: Initializing an integer array
body: <pre><code>string dosage = &quot;2/3/5 mg&quot;;
  string[] dosageStringArray = dosage.Split('/');
  int[] dosageIntArray = null;
  for (int i = 0; i &lt;= dosageStringArray.Length; i++) 
  {
      if (i == dosageStringArray.Length)
      {
          string[] lastDigit = dosageStringArray[i].Split(' ');
          dosageIntArray[i] = Common.Utility.ConvertToInt(lastDigit[0]);
      }
      else
      {
          dosageIntArray[i] = Common.Utility.ConvertToInt(dosageStringArray[i]);
      }
  }
  </code></pre>
  <p>I am getting the exception on this line: <code>dosageIntArray[i] = Common.Utility.ConvertToInt(dosageStringArray[i]);</code>
  I am unable to resolve this issue. Not getting where the problem is. But this line <code>int[] dosageIntArray = null;</code> is looking suspicious.</p>
  <p>Exception: <code>Object reference not set to an instance of an object.</code></p>