title: C++ Parse line of doubles of variable length
body: <p>I am trying to read in a file line by line, parse it based on spaces and place it into a vector called input. However, I cannot do a cin >> x1 >> x2 >> x3 ... because the line doesn't have a set number of terms. Below is what I was thinking, but it could be wrong.</p>
  
  <pre><code>vector &lt;double&gt; input;
  fstream inputFile("../Sphere.in", fstream::in);
  inputFile.open("../Sphere.in", fstream::in);
  
  while (inputFile.good())
  {
      getline(inputFile, line);
  </code></pre>
  
  <p>then something in here that says for each space in line put in input[i]</p>
  
  <pre><code> }
  </code></pre>
  
  <p>I am very new at C++ and would appreciate any help that someone could throw my way.</p>
  
  <p>Thanks,</p>
  
  <p>John</p>