帮个忙好吗? 知道 CString 和 float 怎么相互转换吗 ?别说让我回去看啊 ~嘿嘿~~ 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 long atol( const char *string ); CString temp;float fData;temp.Format("%f",fData);//浮点型到字符。temp=atof(temp.GetBuffer(temp.GetLength())); //字符到浮点型Ok 应该是这样吧:呵呵float a =atof(ctring)CString str.Format("f%",a); 楼上的temp=atof(temp.GetBuffer(temp.GetLength())); //字符到浮点型这样会发生数据丢失吗 ?warning C4244: '=' : conversion from 'double' to 'float', possible loss of data float f;CString str;float转CString时str.Format("%f",f);CString转float时f = atof(str); CString m_lNewNum; float ss;==>ss=atof(m_lNewNum);警告 float a =atof(string)str.Format("%f",a)sprintf(sz, "%f", a) [求助]---------完成端口+AcceptEx,为什么已经连接了,完成端口为什么就Get不到通知?呢 一个用户只允许连续回复3次 vc++ 6.0怎样显示Query菜单? 内存映射文件 怎样用vc实现bmp图像的另存? 如何获取一个刷子的句柄 为什么显示不了值啊? 在DirectX下获取鼠标位置的问题 关于程序自动启动 请教:dll制作简单问题,Mfc扩展dll中如何输出一个类的成员函数? 一个有关VC编辑器的问题 请问是否可以取消对端口的绑定?
float fData;
temp.Format("%f",fData);//浮点型到字符。
temp=atof(temp.GetBuffer(temp.GetLength())); //字符到浮点型
Ok
float a =atof(ctring)
CString str.Format("f%",a);
temp=atof(temp.GetBuffer(temp.GetLength())); //字符到浮点型
这样会发生数据丢失吗 ?
warning C4244: '=' : conversion from 'double' to 'float', possible loss of data
CString str;
float转CString时
str.Format("%f",f);CString转float时
f = atof(str);
float ss;
==>ss=atof(m_lNewNum);
警告
str.Format("%f",a)
sprintf(sz, "%f", a)