title: error with using strptime in c++
body: <p>I've tried to understand use of strptime() in c++ and to be able to do it, I write a short code : </p>
  
  <pre><code>#include &lt;time.h&gt;
  #include &lt;iostream&gt;
  Test(string dtime)  
  {
      string s = dtime;
  
      struct tm timeDate;
      strptime(s,"%y-%m-%d %H:%M", &amp;timeDate);
      cout&lt;&lt;timeDate.tm_sec&lt;&lt;endl;
  }
  </code></pre>
  
  <p>dtime will always be like <em>2013:03:15 16:08</em>. I got the error it says that : </p>
  
  <pre><code>Test(std::string)’:
  Test.cpp:17:41: error: cannot convert ‘std::string* {aka std::basic_string&lt;char&gt;*}’ to ‘const char*’ for argument ‘1’ to ‘char* strptime(const char*, const char*, tm*)
  </code></pre>
  
  <p>Is there anyone to help me to solve my problem ? Thanks in advance</p>