title: Visual C#, An array of Dates between two Dates
body: <p>I have 2 <code>DateTimePicker</code> controls named <code>dtp1</code> and <code>dtp2</code>. I wish to get an array of dates between those 2 days: <strong>dtp1.Date.Value &lt;= x &lt;= dtp2.Date.Value</strong>.</p>
  
  <p>I currently use <code>for</code> loop to achieve such a task, but this is not a very efficient way to do things:</p>
  
  <pre><code>int c = (int)(dtp2.Value.Date-dtp1.Value.Date).TotalDays + 1;
  DateTime[] d = new DateTime[c];
  
  for (int i = 0; i &lt; c; i++)
  {
      d[i] = dtp1.Value.Date.AddDays(i);
  }
  </code></pre>
  
  <p>Is there any better and concise way to achieve the same result?</p>