title: c++ - using std namespace and dependancies
body: <p>While trying to familiarize myself with c++ and its concepts, I came across the </p>
  
  <pre><code>using namespace std
  </code></pre>
  
  <p>and </p>
  
  <pre><code>#include &lt;iostream&gt;
  </code></pre>
  
  <p>my simple code is as follows</p>
  
  <pre><code>#include "stdafx.h"
  #include "ConsoleApplication5.h"
  #include &lt;iostream&gt;     
  
  int main()
  {
      std::cout &lt;&lt; "hi";
      return 0;
  }
  </code></pre>
  
  <p>Using Visual Studio 2015 Community, which uses intellisense, shows </p>
  
  <blockquote>
    <p>cout</p>
  </blockquote>
  
  <p>uses the following</p>
  
  <blockquote>
    <p>std::ostream std::cout</p>
  </blockquote>
  
  <p>As a C# programmer, this confuses me slightly. Is this :</p>
  
  <blockquote>
    <p>std::ostream</p>
  </blockquote>
  
  <p>being a return type while</p>
  
  <blockquote>
    <p>std::cout</p>
  </blockquote>
  
  <p>being the method/parameter passed or is </p>
  
  <blockquote>
    <p>std::ostream</p>
  </blockquote>
  
  <p>a dependancy of </p>
  
  <blockquote>
    <p>cout</p>
  </blockquote>
  
  <p><strong>UPDATE</strong> (after Archimaredes Answer)</p>
  
  <p>In C#, one can use the following:</p>
  
  <pre><code>StreamWriter srWrite;
  </code></pre>
  
  <p>or</p>
  
  <pre><code>StreamWriter srWrite = new StreamWriter(string filepath)
  </code></pre>
  
  <p>or one can use:</p>
  
  <pre><code>StreamWriter srWrite = new StreamWriter(new NetworkStream(Socket.GetStream()));
  </code></pre>
  
  <p>Each case a object of type namely </p>
  
  <pre><code>StreamWriter
  </code></pre>
  
  <p>is assignable with a new object or a existing file or a networkstream.</p>
  
  <p>I tried the same after that which you mentioned (excuse the C# mentality) with the <code>std::ostream x = new std:ostream</code> which returns a no default constructor.</p>
  
  <p>Could you just add how std::ostream and std::cout relate to each other, which creates/initalizes the other. THis concept is still a bit vague to me.</p>