将long double转换为字符串 [英] Convert long double to string
本文介绍了将long double转换为字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
将long double值转换为字符串的最简单方法是什么?
(请帮助我,我只是个初学者)
What is the simplest method to convert a long double value to a string?
(Please help me, I''m just a beginner)
推荐答案
使用 ^ ]应用正确的格式规范 [ ^ ].
Use one of the print
functions[^] applying the correct format specifications[^].
尝试sprintf()
.
您可能还会发现此链接中的文章很有趣:
[ ^ ]
另外这个很好:
[ ^ ]
特别是,如果您具有C ++ 11,则可以使用std::to_string()
.
希望这会有所帮助,
巴勃罗.
Trysprintf()
.
You may find also the article in this link interesting:
[^]
Also this one is nice:
[^]
In particular, if you have C++11, and you can usestd::to_string()
.
Hope this helps,
Pablo.
这篇关于将long double转换为字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文