title: Reading ints from .txt file to vector?
body: <p>For some reason I am getting zero values in my vector when I try to read from a txt file. </p>
  
  <p>Here is my code:</p>
  
  <pre><code>int main(){
      ifstream read("problem13.txt");
      vector&lt;int&gt; source;
      int n;
  
      while (read &gt;&gt; n){
          source.push_back(n);
      }
  
      for (int i = 0; i &lt; source.size(); i++)
          cout &lt;&lt; source[i];
  
     cout &lt;&lt; "Finished.";
  
  }
  </code></pre>
  
  <p>The txt file is rather long but the format is:
  <code>37107287533902102798797998220837590246510135740250</code>
  <code>46376937677490009712648124896970078050417018260538</code>
  <code>74324986199524741059474233309513058123726617309629</code>
  <code>91942213363574161572522430563301811072406154908250</code>
  <code>23067588207539346171171980310421047513778063246676</code></p>