How to iterate through a list of numbers in c++
<p>I have a simple question: how do I iterate through a list of numbers, and how many different ways are there to do it?</p>

<p>What I thought would work:</p>

<pre><code>#include &lt;cstdlib&gt;
#include &lt;iostream&gt;
#include &lt;list&gt;


using namespace std;


int main()

{
    int numbers[] = {2, 4, 6, 8};
    int i = 0;
    for(i=0; i&lt; numbers.size();i++)
            cout &lt;&lt; "the current number is " &lt;&lt; numbers[i];


    system("pause");

    return 0;

}
</code></pre>

<p>I get an error on the for loop line "request for member 'size' in 'numbers', which is of non-class type 'int[4]'"</p>

<p>Thank you for all of the help!</p>
