将long double转换为字符串 [英] Convert long double to string

查看:63
本文介绍了将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().

希望这会有所帮助,

巴勃罗.
Try sprintf().
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 use std::to_string().

Hope this helps,

Pablo.


这篇关于将long double转换为字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆