title: Difference between <cstring> and <string>
body: <p>Earlier today (actually yesterday due to my time-zone) I was attempting a programming interview using <em>Visual Studio 2012</em> for C++ on Interview Street (which uses <em>g++</em>).</p>
  
  <p>To be brief, I came across several compilation errors<sup>1</sup> when I was using</p>
  
  <pre><code>#include &lt;cstring&gt;
  </code></pre>
  
  <p>which was provided by the skeleton code in one of the question, and after turning to </p>
  
  <pre><code>#include &lt;string&gt;
  </code></pre>
  
  <p>all compilation errors magically disappeared.</p>
  
  <p>However, upon submission to Interview Street, I had to add <code>c</code> back; otherwise I got compilation errors.</p>
  
  <p>It was the first time I was bitten by non-standardization....</p>
  
  <p>My question is: what inside <code>&lt;string&gt;</code> and <code>&lt;cstring&gt;</code> took me (precious) more than half an hour?</p>
  
  <hr>
  
  <p><sup>1</sup> For anyone who is curious:</p>
  
  <p>One error by Visual Studio 2012 if <code>using &lt;cstring&gt;</code> is:</p>
  
  <blockquote>
    <p>error C2338: The C++ Standard doesn't provide a hash for this type.</p>
  </blockquote>
  
  <p>in</p>
  
  <blockquote>
    <p>c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstddef</p>
  </blockquote>
  
  <p>possibly for <code>string</code> as key in <code>unordered_map</code></p>
  
  <p>One error by g++ if <code>using &lt;string&gt;</code> is:</p>
  
  <blockquote>
    <p>'strlen' was not declared in this scope</p>
  </blockquote>