请教int,double和CString如何相互转化?
请教如何把int,double 转化为CString????// ----- AsdkintToCString._test command (do not rename)
static void AsdkintToCString_test(void)
{
// Add your code for command AsdkintToCString._test here
int a = 5;
double b = 1.25;
CString str;
str.Format("%d", a);
acedAlert(str);
str.Format("%.2f", b);
acedAlert(str);
} 多谢版主!!! (1)CString转化为int
CString strCount = "2";
int n = atoi(strCount.GetBuffer(0));
strCount.ReleaseBuffer();
(2)CString转化为float
CString strCount = "2.0";
float f = atof(strCount.GetBuffer(0));
strCount.ReleaseBuffer();
http://www.mjtd.com/bbs/skins/default/topicface/face1.gif
谢谢啦
页:
[1]