title: Detect end of line while reading from a text-file C++
body: <p>I am trying to read a text-file based using the <code>&gt;&gt;</code> stream operator, but this seems to read the file word by word:</p>
  
  <pre><code>void printFile(char filename[])
  {
      ifstream input;
      input.open(filename);
  
      char output[50];
      if (input.is_open()) {
          while (!input.eof()) {
              input &gt;&gt; output;
              cout &lt;&lt; output &lt;&lt; endl;
          }
      }
      else cout &lt;&lt; "File is not open!";
  
      input.close();
      cout &lt;&lt; endl;
  }
  </code></pre>
  
  <p>The only problem with this is that it won't print out the linebreaks.</p>
  
  <p>Please note that I'm still learning C++ and the goal is to achieve this without <code>using string</code>s (so without <code>getline</code>). Is there any way of doing this, or is it simply impossible?</p>