title: Using recursive function to read lines of a txt file
body: <p>I'm quite new to c++ and im trying to figure out how to use recursive function to read a .txt file and to save them in a string. I want the function to return a value of true when the reading is finished. I've tried to find solutions on the internet but so far no luck. I've tried the following:</p>
  
  <pre><code>void readFile(ifstream&amp; stream, vector&lt;string&gt; v)
  {
      if (stream.eof()) {
          return true;
      }
      else {
          string line;
          getline(stream, line);
          v.pushback(line);
          readFile(stream, v);
      }
  }
  </code></pre>
  
  <p>Note that I want to use these parameters and I don't want to change them</p>