最佳答案
我有一个浮点值,需要放入一个 std::string。如何从 float 转换为 string?
float val = 2.5;
std::string my_val = val; // error here