1. 程式人生 > >CString與 char*互轉問

CString與 char*互轉問

mfc

1.CString轉char*

CString ctrpath;
CStringA strPathA = CW2A(ctrpath.GetBuffer(), CP_THREAD_ACP);
    char*temp=strPathA.GetBuffer();
  1. char*轉CString(註意是大寫 S 小寫亂碼)
    CString str;
    str.Format(_T("%S"), charSource2);

CString與 char*互轉問