(7)double/float->CString double data; CString.Format("%.2f",data); //保留2位小数 (8)CString->double CString s="123.12"; double d=atof(s); (9)string->double double d=atof(s.c_str()); 2、数字转字符串:使用sprintf()函数 char str[10]; int a=1234321; sprintf(str,"%d",a); -...
CString name=L"12345"; char query[225]; 方法一: CString是unicode编码 使用%S sprintf(query, "select * from tb_user where account=\'%S\'", name); 方法二: 使用CStringA(name)转化成string sprintf(query, "select * from tb_user where account=\'%S\'", CStringA(name));...
(7)double/float->CString double data; CString.Format("%.2f",data); //保留2位小数 (8)CString->double CString s="123.12"; double d=atof(s); (9)string->double double d=atof(s.c_str()); 2、数字转字符串:使用sprintf()函数 char str[10]; int a=1234321; sprintf(str,"%d",a); -...