title: Difference between fstream, ofstream, ostream, iostream
body: <p>I'm taking a quiz on an intro level class in C++ and I'm trying to understand a question.  After searching the internet and not getting an answer, so here I am.</p>
  
  <pre><code>Which of the following function declarations will accept either cout or a file stream 
  object as its argument?
  
  A. void output( fstream &amp;outFile);  
  B. void output( ofstream &amp;outFile); 
  C. void output( ostream &amp;outFile);  
  D. void output( iostream &amp;outFile);
  </code></pre>
  
  <p>The answer is C.  </p>
  
  <p>I know the difference between: fstream, ofstream, ostream, iostream.  </p>
  
  <p>What I don't understand is why none of the other options are able to accept the cout or file stream object as an argument.  </p>
  
  <p>Is the answer as simple as ostream objects contain data (char,etc) that are able to be passed as arguments?</p>
  
  <p>Any information would be greatly appreciated.</p>