how to copy char * into a string and vice-versa
<p>If i pass a char * into a function. I want to then take that char * convert it to a std::string and once I get my result convert it back to char * from a std::string to show the result. </p>

<ol>
<li>I don't know how to do this for conversion ( I am not talking const char * but just char *)</li>
<li>I am not sure how to manipulate the value of the pointer I send in.</li>
</ol>

<p>so steps i need to do </p>

<ol>
<li>take in a char *</li>
<li>convert it into a string.</li>
<li>take the result of that string and put it back in the form of a char *</li>
<li>return the result such that the value should be available outside the function and not get destroyed. </li>
</ol>

<p>If possible can i see how it could be done via reference vs a pointer (whose address I pass in by value however I can still modify the value that pointer is pointing to. so even though the copy of the pointer address in the function gets destroyed i still see the changed value outside.</p>

<p>thanks!</p>
