+ -
当前位置:首页 → 问答吧 → 急,vc++中如何将CString型转换成double型

急,vc++中如何将CString型转换成double型

时间:2011-12-25

来源:互联网

求大神帮帮忙。。。不知道有没有现成的函数!

作者: herykk   发布时间: 2011-12-25

CString str="34.2342";
double f=_wtof(str.GetBuffer(str.GetLength()));

作者: chinatcp   发布时间: 2011-12-25

CString thestring("13.37");
double d = atof(thestring).

如果是unicode字符集

CString thestring(L"13.37");
double d = _wtof(thestring).

或者是否unicode字符集都通用的:

CString thestring(_T("13.37"));
double d = _tstof(thestring).

作者: fight_in_dl   发布时间: 2011-12-25

_tcstod();

作者: VisualEleven   发布时间: 2011-12-25