title: stoi being printed to console when using std::stoi
body: <p>Given a file that contains one integer per line, I am trying to use this code to read the file and store the numbers in a vector.</p>
  
  <p>Strangely, after finishing reading the file, my program is printing the string "stoi". Is this just a behavior of std::stoi? I couldn't find anything about this in documentation.</p>
  
  <p>I am using g++ 6.2.1.</p>
  
  <p>Here is the relevant code:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;fstream&gt;
  #include &lt;sstream&gt;
  #include &lt;string&gt;
  #include &lt;vector&gt;
  
  void usage() {
      std::cout &lt;&lt; "Usage: ./binary_tree [FILE]\n";
  }
  
  int main(int argc, char* argv[]) {
  try{
       if (argc &lt;= 1) {
           usage();
           return 1;
       }
  
       std::ifstream inputFile;
       inputFile.open(argv[1], std::ios::in);
  
       if (!inputFile.is_open()) throw std::runtime_error("Failed to open file");
  
       std::string line;
       std::vector&lt;int&gt; nums;
  
       while(!inputFile.eof()) {
           getline(inputFile, line);
           int num = std::stoi(line);
           nums.push_back(num);
       }
  
       // Clean up
       inputFile.close();
       return 0;
  }
  
  catch(const std::exception&amp; e) {
      std::cerr &lt;&lt; e.what() &lt;&lt; std::endl;
  }
  }
  </code></pre>