问题:
I need to store a double as a string. 我需要将double存储为字符串。 I know I can use printf
if I wanted to display it, but I just want to store it in a string variable so that I can store it in a map later (as the value , not the key ). 我知道如果我想显示它我可以使用printf
,但我只是想将它存储在一个字符串变量中,以便我以后可以将它存储在一个地图中(作为值 ,而不是键 )。
解决方案:
参考一: https://en.stackoom.com/question/1OOd参考二: https://stackoom.com/question/1OOd