SyntaxFix
Write A Post
Hire A Developer
Questions
Just see this:
string str1("stackoverflow"); const char * str2 = str1.c_str();
However, note that this will return a const char *.
const char *
For a char *, use strcpy to copy it into another char array.
char *
strcpy
char