-
string to char*
std::string str = “Hello Word”;
char* mychar = str.c_str();
-
char* to string
std::string str0 = “Hello Word”;
std::string str1;
strcpy(str1,str0.c_str()); // strcat to add
Reference:
http://www.flounder.com/cstring.htm
std::string str = “Hello Word”;
char* mychar = str.c_str();
std::string str0 = “Hello Word”;
std::string str1;
strcpy(str1,str0.c_str()); // strcat to add
Reference:
http://www.flounder.com/cstring.htm