title: Copying a std::string to char*
body: <p>I am trying to create a copy of a std::string to a char*. This is my function and its seen result:</p>
  
  <pre><code>void main()
  {
  std::string test1;
  std::cout &lt;&lt; "Enter Data1" &lt;&lt; std::endl;
  std::cin &gt;&gt; test1;
  char* test2;
  test2 = (char*)test1.c_str();
  std::cout &lt;&lt; "test1: "&lt;&lt; &amp;test1 &lt;&lt; std::endl;
  std::cout &lt;&lt; "test2: "&lt;&lt; &amp;test2 &lt;&lt; std::endl;
  }
  
  Enter Data1
  Check
  test1: 0x7fff81d26900
  test2: 0x7fff81d26908
  </code></pre>
  
  <p>I am unsure if a copy has been created or both of them are pointing to the same location.
  How to confirm this?</p>