Out of bounds exception on incrementing variable
<p>I've been while out of C# and MVC. And I am really struggling with the following error, I really don't see it. I have a list of restrictions and i want to add their keys to an string[].</p>

<pre><code>int cntr = 0;
//loop through restrictions and add to array
foreach (var Restriction in this.admingroupRepository.Context.AdminRestrictions.ToList())
{
    currentRestrictionKeys[cntr] = Restriction.Key;
    cntr += 1;
}
</code></pre>

<p>This is the error i get on the cntr += 1 line:</p>

<pre><code>Index was outside the bounds of the array.
</code></pre>

<p>I don't understand where this comes from, the foreach breaks before the cntr is out of the array's bounds right?</p>
