Are multiple sequential array access optimised?
<p>Will C++ compilers automatically optimise the following code to calculate 3*i only once, and increment the result, or must the programmer code this?</p>

<pre><code>void writeToArray(int i, int a, int b, int c)
{
   array[3*i][1]=a;
   array[3*i][2]=b;
   array[3*i][3]=c;
}
</code></pre>
