問題:
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