title: why does accessing C++ string class through string.h work?
body: <p>In the C++ program below, I include the string.h file and I successfully instantiate the C++ string class in it and call one of its member functions: size().</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;string.h&gt;
  using namespace std;
  
  int main( )
  {
      string s = "Hello";
      cout &lt;&lt; "String: " &lt;&lt; s &lt;&lt; endl;
      cout &lt;&lt; "Size of string: " &lt;&lt; s.size() &lt;&lt; endl;
      cin.get();
      return 0;    
  }
  </code></pre>
  
  <p>The output is:</p>
  
  <pre><code>String: Hello
  Size of string: 5
  </code></pre>
  
  <p>I am using Dev-C++ 4.9.9.2</p>
  
  <p>My question: doesn't the string.h file just provide the functions for manipulating C strings? It doesn't include the definition of the C++ string class right? So, how is it that I am able to access the C++ string class without using <code>#include &lt;string&gt;</code>? My understanding is that the string.h file is the C strings library file and <code>&lt;string&gt;</code> includes the C++ string library file. Is this not right?</p>
  
  <p>Thanks! </p>