我在对话框中添加了一个Edit控件,将该控件关联了一个CString类型的变量m_edit;
我现在想得到在该控件输入的变量,以便进行计算。
各位大侠我知道通过atoi将其转换成整型,但是不知道如何将其转换成double型呢?
请各位大侠帮帮我,谢谢!!!
我现在想得到在该控件输入的变量,以便进行计算。
各位大侠我知道通过atoi将其转换成整型,但是不知道如何将其转换成double型呢?
请各位大侠帮帮我,谢谢!!!
解决方案 »
- 18号回家, 散分!
- IWebBrowser 求救
- 为什么我的这个程序退出了,进程却没杀掉啊??急 先谢谢大家了
- ASCII to UNICODE conversion
- 一本所有搞编程的人员都想得到的书籍!(刊登部分内容)
- zhou80bin(彬彬)请进,GUID和上一次的问题
- 初学者求助
- 调用DeleteAllItems()发生错误
- 关于线程的问题,起线程后又立即CloseHandle,这样线程函数被关闭了吗,为什么要立即CloseHandle呢,这是规范的编程习惯吗?原码在里面
- 关于电子版本的《深入浅出mfc》,一定要帮帮我。。。
- 如何图像处理 OCR?谢谢指教!
- 50分,,MessageBox的nType参数,API到底是怎么判断的?
// crt_atof.c
//
// This program shows how numbers stored as
// strings can be converted to numeric
// values using the atof function.#include <stdlib.h>
#include <stdio.h>int main( void )
{
char *str = NULL;
double value = 0; // An example of the atof function
// using leading and training spaces.
str = " 3336402735171707160320 ";
value = atof( str );
printf( "Function: atof( \"%s\" ) = %e\n", str, value ); // Another example of the atof function
// using the 'd' exponential formatting keyword.
str = "3.1412764583d210";
value = atof( str );
printf( "Function: atof( \"%s\" ) = %e\n", str, value ); // An example of the atof function
// using the 'e' exponential formatting keyword.
str = " -2309.12E-15";
value = atof( str );
printf( "Function: atof( \"%s\" ) = %e\n", str, value );}
1)_MBCS
atof( const char *string );
2) _UNICODE
_tcstod(m_edit, NULL);