找回密码
 注册
查看: 730|回复: 4

double to String!!

[复制链接]
发表于 2003-5-14 01:33:20 | 显示全部楼层 |阅读模式
在C++里怎么把double转换成string 或者 char*呀!!
发表于 2003-5-14 08:57:36 | 显示全部楼层
I think that is impossible. Can you do that in C? and how?
回复

使用道具 举报

发表于 2003-5-14 10:31:31 | 显示全部楼层
C里可以用sprintf(s, "%lf", d);
C++就不清楚了。
回复

使用道具 举报

发表于 2003-5-14 11:45:12 | 显示全部楼层
晕倒 这个简直每个程序里都在做的事情 简单的就象上面这么解决阿
c++里难道有人禁止你使用c的库函数??
回复

使用道具 举报

发表于 2003-5-14 23:29:34 | 显示全部楼层
here need check the size of s, take care overflow.
use string class can also do this.
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

GMT+8, 2025-2-25 04:47 , Processed in 0.044851 second(s), 15 queries .

© 2001-2025 Discuz! Team. Powered by Discuz! X3.5.

快速回复 返回顶部 返回列表