逆水行船

别人的天堂,是我的异乡;无端的繁华,倍添我的惆怅

 

char转换为double;int转换为char;CString转换为char*

char转换为double
char* chaValue = "116.397380;39.908395";
double x = 0.0;
 double y = 0.0;
 sscanf(chaValue, "%lf;%lf", &x, &y);

int转换为char
int m_btCommPort = 1;
 int m_dwBaudrate = 4800;
CString strCommPort;
 strCommPort.Format("%d", m_btCommPort);
 CString strBaudrate;
 strBaudrate.Format("%d", m_dwBaudrate);
 CString chaValueString = strCommPort + ";" + strBaudrate;
 int length = chaValueString.GetLength();
 char* chaValue = new char[length];
 chaValue = chaValueString.GetBuffer(length);


CString title = "我是六子";
char* pCh = title.GetBuffer(title.GetLength());

posted on 2008-01-23 14:36  荣-  阅读(9833)  评论(0编辑  收藏  举报

导航