title: C++ Do I have to include standard libraries for every source file?
body: <p>I'm a bit confused at the moment because I'm planning to include multiple source and header files for the first time in one of my projects.<br>
  So I'm wondering if this would be the right approach?<br>
  Do I have to include the string header in every source file that uses it directly?<br>
  And what about the "stdafx.hpp" header that Visual C++ wants me to include?  </p>
  
  <p>Would that be the way to go?</p>
  
  <p><strong>main.cpp</strong></p>
  
  <pre><code>#include "stdafx.hpp"
  #include &lt;string&gt; //?
  #include &lt;stringLib1.h&gt;
  #include &lt;stringLib2.h&gt;
  using std::string;
  
  //use a windows.h function here
  //use a stringLib1 function here
  //use a stringLib2 function here
  </code></pre>
  
  <p><strong>stringLib1.h</strong></p>
  
  <pre><code>#include "stdafx.hpp"
  #include &lt;string&gt;
  using std::string;
  
  class uselessClass1
  {
  public:
      string GetStringBack1(string myString);
  };
  </code></pre>
  
  <p><strong>stringLib1.cpp</strong></p>
  
  <pre><code>#include "stdafx.hpp"
  
  string uselessClass1::GetStringBack1(string myString) {
      return myString;
  }
  </code></pre>
  
  <p><strong>stringLib2.h</strong></p>
  
  <pre><code>#include "stdafx.hpp"
  #include &lt;string&gt;
  using std::string;
  
  class uselessClass2
  {
  public:
      string GetStringBack2(string myString);
  };
  </code></pre>
  
  <p><strong>stringLib2.cpp</strong></p>
  
  <pre><code>#include "stdafx.hpp"
  
  string uselessClass2::GetStringBack2(string myString) {
      return myString;
  }
  </code></pre>