分类:
2008-06-24 15:57:35
1。 int <->CString |
Int 转CString :
int n=1;
CString str;
str.Format("%d",n);
CString 转 Int
CString str="1";
int n=atoi(str.GetBuffer(0));
2. char* 与CString
char * 转 CString:
char sz[128];
CString str;
str.Format("%s",sz);
CString 转 char *:
CString str;
int nLength=str.GetLength();
char * sz=new char[nLength];
sz=str.GetBuffer(0);
3. float<->CString
1)float->CString
float f = 0.0;
CString str;
str.Format("%f",f);
2) CString->float
CString str = "0.0";
float f = atof(str.GetBuffer(0));