相关疑难解决方法(0)

C++从1个字符串转换为字符串?

我真的没有找到任何接近的答案......

相反的方式非常简单,如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)

c++ casting

108
推荐指数
3
解决办法
24万
查看次数

标签 统计

c++ ×1

casting ×1