Summary: Record the conversion methods between string type, int type, const char type and char type in C++.
1. Interchange between string and const char*
1.string --> const char*
string str = "asf";
const char* ch = str.c_str();
string str = "asf";
const char* ch = str.data();
2. Convert between const char* and char*
1.const char* --> char*
memcpy(pCh,str.c_str(),sizeof(str));
2.char* --> const char*
3. Convert between string and int
1.string --> int
string str = "234";
int num = atoi(str.c_str());
num = stoi(str);
2.int --> string
int num = 9998;
string str = to_string(num);