You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
conversion between string, char*, const char* Back
string
to char*
string s = "abc";
/* new a char pointer and point to a char instance with the size */char* c;
constint len = s.length();
c = newchar[len + 1];
/* use strcpy to copy string to the char instance */strcpy(c, s.c_str());