//string 转char*
string str_3 = "String to char*";
char* a_2;
int lenOfStr = str_3.length();
a_2 = new char[lenOfStr];
strcpy(a_2,str_3.c_str());
cout<<a_2<<endl;
//string转char* 方法2
string str_31 = "String to char* function 2";
char* a_31;
a_31 = const_cast<char*>(str_31.c_str());
cout<<"the function of String to Char* "<< a_31<<endl;