Array of struct - array elements are reference or value type?
<p>How does C# handle arrays of struct - do I need to allocate each array element (as if it was an array of class objects)?</p>

<p>Example:</p>

<pre><code>public struct RGBA { public byte red, green, blue, alpha; }

public RGBA [] colorBuffer = new RGBA [1024*1024];
</code></pre>

<p>Now is colorBuffer an array of pointers to RGBA objects, and do I have to allocate them, e.g. like this:</p>

<pre><code>for (int i = 0; i &lt; colorBuffer.Length; i++)
    colorBuffer [i] = new RGBA ();
</code></pre>

<p>or does colorBuffer point to a memory chunk of 4 MB in size, containing 1 MB RGBA structs?</p>
