字符串拷贝strcpy的问题,大家来看看。
djfu 2005-05-23 10:41:51 char sc[20];
CString ss = "test";
strcpy(sc, ss);
/*
编译提示出错:
error C2664: 'strcpy' : cannot convert parameter 2 from 'class CString' to 'const char *'
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
*/
strcpy(sc,ss.Operator LPCTSTR());
/*
编译提示出错:
error C2664: 'strcpy' : cannot convert parameter 2 from 'const unsigned short *' to 'const char *' ,Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
*/
怎么改正呢?