更新时间:2023-11-14 19:56:52
CString直接转换为const char *
CString casts to const char * directly
CString temp;
temp = "Wow";
const char * foo = (LPCSTR) temp;
printf("%s", foo);
将打印'foo'
版本的MFC也支持GetString()方法:
Newer version of MFC also support the GetString() method:
CString temp;
temp = "Wow";
const char * foo = temp.GetString();
printf("%s", foo);