1. CString 转int long double
CString str = "";
double x = _wtof(str);
int x = _wtoi(str);
long x = _wtol(str);
// atoi atof 这些函数会报错
// 因为参数要是( const char* )
2. int ,double ,long 转CString
str.Format(_T("%.4d"),x);
MFC double char int 与 CString 相互转换
最新推荐文章于 2022-03-23 10:59:09 发布