<p>Probably a really simple one this - I'm starting out with C# and need to add values to an array, for example:</p>

<pre><code>int[] terms;

for(int runs = 0; runs &lt; 400; runs++)
{
    terms[] = runs;
}
</code></pre>

<p>For those who have used PHP, here's what I'm trying to do in C#:</p>

<pre><code>$arr = array();
for ($i = 0; $i &lt; 10; $i++) {
    $arr[] = $i;
}
</code></pre>

You have to allocate the array first:
```
```
int [] terms = new int[400]; // allocate an array of 400 ints
for(int runs = 0; runs < terms.Length; runs++) // Use Length property rather than the 400 magic number again
{
    terms[runs] = value;
}
```
```