title: How to read a file line by line or a whole text file at once?
body: <p>I'm in a tutorial which introduces files (how to read from file and write to file)</p>
  <p>First of all, this is not a homework, this is just general help I'm seeking.</p>
  <p>I know how to read one word at a time, but I don't know how to read one line at a time, or how to read the whole text file.</p>
  <p>What if my file contains 1000 words? It is not practical to read entire file word after word.</p>
  <p>My text file named &quot;Read&quot; contains the following:</p>
  <pre class="lang-none prettyprint-override"><code>I love to play games
  I love reading
  I have 2 books
  </code></pre>
  <p>This is what I have accomplished so far:</p>
  <pre class="lang-cpp prettyprint-override"><code>#include &lt;iostream&gt;
  #include &lt;fstream&gt;
  
  using namespace std;
  int main (){
     
    ifstream inFile;
    inFile.open(&quot;Read.txt&quot;);
  
    inFile &gt;&gt;
  </code></pre>
  <p>Is there any possible way to read the whole file at once, instead of reading each line or each word separately?</p>