본문 바로가기
Develope/c++, mfc

[C++/MFC] 문자열 변환, CString to char

by 개발자도구 2022. 10. 17.
반응형

Cpp File

CString str = "CString to char";
int length = str.GetLength();
char* pChr = new char[length];
strcpy(pChr, str.GetBuffer(0));

delete[] pChr;
pChr = NULL;

 

반응형

댓글