title: iostream vs ostream what is different?
body: <p>As the book says (Exploring C++: The Programmer's Introduction to C++):</p>
  
  <blockquote>
    <p>The istream header declares input operators (>>), and ostream declares
    output operators(&lt;&lt;).</p>
  </blockquote>
  
  <p>I can perfectly run the code without adding <code>#include &lt;ostream&gt;</code>:</p>
  
  <pre class="lang-cpp prettyprint-override"><code>#include &lt;iostream&gt;
  using namespace std;
  int main()
  {
      cout &lt;&lt; "hello world"&lt;&lt; endl;
      return 0;
  }
  </code></pre>
  
  <p>But, in book's example like:</p>
  
  <pre class="lang-cpp prettyprint-override"><code>#include &lt;iostream&gt;
  #include &lt;ostream&gt;    //why?
  using namespace std;
  int main()
  {
      cout &lt;&lt; "hello world"&lt;&lt; endl;
      return 0;
  }
  </code></pre>
  
  <p>So,  <code>iostream</code>, <code>ostream</code> and <code>istream</code> are header files right?</p>
  
  <p>If <code>ostream</code> is not necessary (<code>iostream</code> does the job) <strong>why does the author include it</strong> in the example? Or why does the <code>ostream</code> header file <strong>still exist</strong>?</p>
  
  <p><strong>Note</strong>: In Bruce Eckel's Vol 1 book (which is published in 2000) there is nothing about <code>ostream</code> or <code>istream</code>. Only one header file which is <code>iostream</code>.</p>