如何在Python中將double轉換爲字符串? - How do I convert a double into a string in C++?

問題:

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
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章