title: How to prevent "index" to updated itself in array of Action
body: <p>When I add to <code>array</code> of <code>Actions</code> with a  <code>for loop</code> a <code>delegate</code> the I is updated across the array. How to prevent that from happening?</p>
  
  <p>I have tried assigning the "I" to an integer before adding that works.</p>
  
  <pre><code>Action[] actions = new Action[100];
  
  for (int i = 0;i&lt; actions.Length; i++)
  {
      actions[i] = () =&gt; Console.WriteLine("Hello"+ i);
  }
  </code></pre>
  
  <p>"I" in each Action in <code>Action[]</code> is 100; </p>
  
  <p>Why is that?</p>