title: Getting number values from text file C++
body: <p>I'm new to c++ and need help getting numbers from a text file and multiplying them. I'm able to display the text but I don't know how to retrieve the numbers from the text file in order for me to multiply them.  ( the input.txt file is just a file that has random names associated with numbers. I want to get the numbers from the text so I can multiply them).Thank you.</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;fstream&gt;
  #include &lt;string&gt;
  using namespace std;
  
  int main () {
      string line;
      ifstream myfile ("input.txt");
      if (myfile.is_open())
      {
          while ( getline (myfile,line) )
          {
              cout &lt;&lt; line &lt;&lt; '\n';
          }
          myfile.close();
      }
      else
          cout &lt;&lt; "Unable to open file";
      system("pause");
      return 0;
  } 
  </code></pre>