title: How can i read string and integer, on same line from a text file?
body: <p>I have this example, </p>
  
  <p>On my .txt file i have “Jorge Saraiva 1321312”</p>
  
  <p>my .cpp </p>
  
  <pre><code>string line, nome;
  int number;
  
  ifstream ifi("nameOfFile.txt");
  
   if(!ifi.is_open()){
     cout &lt;&lt; "Error opening file" &lt;&lt; ends;
   }
   {
    else{
      while( getline(ifi,line) ){
        istringstream is(line);
  
         is &gt;&gt; nome; 
         is &gt;&gt; number; 
      }
      ifi.close();
    }
   cout &lt;&lt; nome  &lt;&lt; endl &lt;&lt; number &lt;&lt; ends;
  </code></pre>
  
  <p>With this i only got first name ("Jorge"), I'm not sure how can i tell compiler when the name/string ends.</p>