Using while / do-while loops for array element setting
<p>I'm having some trouble understanding how to use a while loop to get the same results as this for loop:</p>

<pre><code>for (int i=0; i&lt;N; i++){
    int datum[i] = 0;
}
</code></pre>

<p>Basically, to set all the elements in the array datum[N] to 0.
Does the following code make sense in that regard, or am I missing something?  thanks</p>

<pre><code>int i = 0;
while (i &lt; N){
    datum[i] = 0;
    i++;
}
</code></pre>