Reading from a File to an array
<p>I have the code bellow that populates an array and prints the array out, it then prints the array out in reverse order.  My question is now that I have done that, how can I instead of populating the list from a loop, populate it from a file instead?</p>

<p>Code:</p>

<pre><code>void popArray(int array1[]){
  for(int x = 0; x &lt; 10; x++){
    array1[x] = x;
    cout &lt;&lt; setw(2) &lt;&lt; array1[x];
  }
}

void reverseList(int array1[]){
  for(int x = 9; x &gt; -1; x--){
    cout &lt;&lt; setw(2) &lt;&lt; array1[x];
  }
}


int main()
{
  int array1[9];

  popArray(array1);

  cout &lt;&lt; "\n";

  reverseList(array1);
}
</code></pre>
