strcpy”: 不能将参数 2 从“CString”转换为“const char *”
我做的是 strcpy(title,m_sztitle); 参数1 title声明如下 :char title[100]
参数2 m_sztitle 声明如下: CString m_sztitle;
为什么会出错啊
我做的是 strcpy(title,m_sztitle); 参数1 title声明如下 :char title[100]
参数2 m_sztitle 声明如下: CString m_sztitle;
为什么会出错啊
TCHAR title[100];
_tcscpy(title,m_sztitle);
strcpy(title,m_sztitle.GetBuffer(m_sztitle.GetLength()));
strcpy(title, m_sztitle.GetBuffer(0));
m_sztitle.ReleaseBuffer();
//以下也行
strcpy(title, (LPSTR)(LPCSTR)m_sztitle);//最好判断下m_sztitle.GetLength()是否 >= 100