title: namespace in C++ when using c function
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/7531866/unresolved-overloaded-function-type-c">unresolved overloaded function type c++</a>  </p>
  </blockquote>
  
  
  
  <p>Consider the code snippet below:</p>
  
  <pre><code>#include &lt;algorithm&gt;
  #include &lt;cctype&gt;
  #include &lt;string&gt;
  using namespace std;
  void test(){
      std::string str = "Hello World!";
      std::transform(str.begin(), str.end(), str.begin(), tolower);
  }
  </code></pre>
  
  <p>There is an error about <code>tolower</code> when compiling with G++: <strong>unresolved overloaded function</strong>.</p>
  
  <p>If <code>using namespace std;</code> is removed, the code works fine.</p>
  
  <p>Then, my questions are:</p>
  
  <ul>
  <li>What is the relationship between <code>namespace std</code> with C functions?</li>
  <li>What is the difference between <code>#include&lt;ctype.h&gt;</code> and <code>#include&lt;cctype&gt;</code>? Although both of them don't work in the example above.</li>
  <li>Why <code>std::tolower</code> also doesn't work? What's the difference between <code>std::tolower</code> and <code>tolower</code>?</li>
  </ul>