I want to convert a std::string into a char* or char[] data type.
(我想将std :: string转换为char *或char []数据类型。)
std::string str = "string";
char* chr = str;
Results in: “error: cannot convert 'std::string' to 'char' ...” .
(结果: “错误:无法将'std :: string'转换为'char'...” 。)
What methods are there available to do this?
(有什么方法可以做到这一点?)
ask by Mario translate from so