Matt’s 리뷸로그

[MFC] Cstring <-> Char* 형변환 본문

Works

[MFC] Cstring <-> Char* 형변환

matt131 2012. 12. 26. 16:01
반응형


CString Char* 형 변환 하는법
 

CString -> Char *

 

CString strBuffer;
char szBuffer[MAX_PATH] = {0,};
int nLength = (MAX_PATH > strlen(strBuffer)) ? strlen(strBuffer) : MAX_PATH;
strncpy(szBuffer, (LPSTR)(LPCSTR)strBuffer, nLength);


 

Char * -> CString

CString strBuffer;
char szBuffer[MAX_PATH];
strBuffer = (LPSTR)szBuffer;

 

반응형
0 Comments
댓글쓰기 폼