CString str=“hello”;memcpy(p, str, str.GetLength());方法2:char *p1;p1 = str.GetBuffer(str.GetLength());方法3:char *p1;p1 = (LPSTR)(LPCTSTR) str;
这是unsigned 字符数组,和一般的char array =>string不同,需要强制类型转换。方法很多,如下列举3种:【我用的GCC编译器, 用string演示;VC的CString方法相同】include <iostream>#include <string>#include <algorithm>#include <iterator>#include <sstream>using namespace std;int main(int argc, c...