title: Going from string to stringstream to vector<int>
body: <p>I've this sample program of a step that I want to implement on my application. I want to push_back the int elements on the string separately, into a vector. How can I? </p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;sstream&gt;
  
  #include &lt;vector&gt;
  
  using namespace std;
  
  int main(){
  
      string line = "1 2 3 4 5"; //includes spaces
      stringstream lineStream(line);
  
  
      vector&lt;int&gt; numbers; // how do I push_back the numbers (separately) here?
      // in this example I know the size of my string but in my application I won't
  
  
      }
  </code></pre>