VC6:在MFC对话框中将字符串转换为双精度 [英] VC6: Convert String to Double in MFC Dialog
本文介绍了VC6:在MFC对话框中将字符串转换为双精度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我将变量声明为CString
,并且尝试使用以下语句将其转换为double.
Hi,
I declared the variable as CString
and I''m trying to convert it as double using the following statement.
double Principal = _wtof(m_Principal);
但它给出错误为 _wtof undeclared identifier
我该如何解决这个错误.如果我的陈述有误,请告诉我如何在基于MFC Dialog的应用程序中将字符串转换为双精度
谢谢.
but it gives the error as _wtof undeclared identifier
How can I solve this error. If my statement is wrong then tell me how to convert a string to double in MFC Dialog based application
Thanks.
推荐答案
使用atof()函数
use the function atof()
double Principal = atof(m_Principal);
http: //msdn.microsoft.com/en-us/library/hc25t012%28v=vs.80%29.aspx [
我们有一个函数名称atoi ()在库中.
atoi()-> ASCII转换为整数
....... var =(double)(atoi(variable)).........
希望你知道......)we have a function name atoi() in the library.
atoi() -> Ascii to integer
.......var = (double)(atoi(variable)).........
hope rest you knows... :)
这篇关于VC6:在MFC对话框中将字符串转换为双精度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文