title: need help reading file contents into an array C++
body: <p>I want to be able to do $> ./program file.txt 8
  and then read the 8 values inside file.txt into an array</p>
  
  <p>heres the code I have right now but it doesn't work </p>
  
  <pre><code>int main(int argc, char *argv[])
  {
      ifstream file;
      int size;
      int arr[size],val;
      for(int i=0;i&lt;size;i++)
      {
          cin&gt;&gt;val;
          arr[i] = val ;
      }
  </code></pre>