Convert between CString and char*

1. CString to char*

CString ctrpath;
CStringA strPathA = CW2A(ctrpath.GetBuffer(), CP_THREAD_ACP);
    char*temp=strPathA.GetBuffer();
  1. char* to CString (note that the uppercase S is lowercase garbled)
    CString str;
    str.Format(_T("%S"), charSource2);

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324691916&siteId=291194637