title: using namespace std; in a header file
body: <p>So, I have the following in a specification file</p>
  
  <pre><code>#include &lt;string&gt;
  #include &lt;fstream&gt;
  using namespace std:
  
  class MyStuff
  {
      private:
  
      string name;
      fstream file;
      // other stuff
  
      public:
      void setName(string);
  }
  </code></pre>
  
  <p>I also have in the implementation file</p>
  
  <pre><code>#include "MyStuff.h"
  using namespace std;
  
  void MyStuff::setName(string name);
  {
       name = name
  }
  </code></pre>
  
  <p>and in the program file I have...</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;string&gt;
  using namespace std;
  
  void main()
  {
       string name;
       MyStuff Stuff;
  
       cout &lt;&lt; "Enter Your Name: ";
       getline(cin, name);
  
       Stuff.setName(name);
  }
  </code></pre>
  
  <p>And I'm gathering that applying "using namespace std;" in a header file is a no-no, and that to fully qualify is the "better" practice; such as <code>std::cout &lt;&lt; stuff &lt;&lt; endl;</code></p>
  
  <p>It is my understanding that in order to use a string, it must have the std namespace. Is that true?</p>
  
  <p>If so, in the header file, is more "pure/clean" to do it as...</p>
  
  <pre><code>#include &lt;string&gt;
  
  class MyStuff
  {
       std::string name;
  }
  </code></pre>
  
  <p>And, as I understand it currently, using namespace std; across all three files, specification, implementation, and program, essentially layers the three namespaces on top of each other, so if I separately declare <code>string name;</code> within each of the files, the compiler will not know which goes to what. Is that true?</p>
  
  <p>I generally understand that being clear is a "good" thing to do, I am however a little unclear on the specificity of how, and I'm most interested in the deeper "why" that underlies it all.</p>
  
  <p>So my direct question is, in my example provided, what is the "clearest" way to describe the function both for the compiler and for industry "standard"? And, can you direct me to resources that more clearly delineate the reasoning and practical implementation of namespaces.</p>