这个方法试过了,不行!应为Cstring实际上是数组,没法转换为double
[此贴子已经被作者于2006-1-31 10:14:05编辑过]
atof()
CString to Double:CString str="flant";int b[10],i;LPCSTR a=str;for(i=0;i<10;i++){ b[i]=a[i];
}
Double to CString:
CString str;
int a=10;
str.format("%d",a);
int to double? I have no test it.
1. CString to float:CString m_str1;float f = (float)atof((LPCSTR)m_str1);2. float to CString.float m_f1;CString strOutput;strOutput.Format("%12.7f", m_f1);