我有一个使用char数组作为字符串的ac库,我想在我的代码上使用c ++ std :: string,有人可以帮助我如何在char*c样式字符串和STL库字符串之间进行转换?
例如我有:
char *p="abcdef";
string p1;
Run Code Online (Sandbox Code Playgroud)
和
string x="abc";
char *x1;
Run Code Online (Sandbox Code Playgroud)
我怎样才能将p转换为p1和x转换为x1