title: Reading numbers from file to string to array
body: <p>I am reading numbers from a file, say:</p>
  
  <p>1 2 3 4 5</p>
  
  <p>I want to read this data from a file into a string into an array for further processing. Here's what I've done:</p>
  
  <pre><code>float *ar = nullptr;
  while (getline(inFile, line))
  {
      ar = new float[line.length()];
      for (unsigned int i = 0; i &lt; line.length(); i++)
      {
            stringstream ss(line);
            ss &gt;&gt; ar[i];
      }
  }
  unsigned int arsize = sizeof(ar) / sizeof(ar[0]);
  delete ar;
  </code></pre>
  
  <p>Suffice it to say that it works insofar it only gets the first value from the file. How do I get the array to be input ALL the values? I debugged the program and I can confirm that line has all the necessary values; but the float array doesn't. Please help, thanks!</p>