我真的没有找到任何接近的答案......
相反的方式非常简单,如str [0]
但我只需要将1个字符串转换为字符串...
像这样:
char c = 34;
string(1,c);
//this doesn't work, the string is always empty.
string s(c);
//also doesn't work.
boost::lexical_cast<string>((int)c);
//also return null
Run Code Online (Sandbox Code Playgroud)