본문 바로가기

Programming/MFC

CString to char

출처 : http://lowchen.tistory.com/288

1
2
3
4
5
6
CString strTemp = "This is test.";
char szTemp[256= {0};
 
memcpy( szTemp, strTemp, strTemp.GetLength() );
 
memcpy( szTemp, strTemp.GetBuffer(0), strTemp.GetLength() );
cs


위의 두 memcpy는 같은 동작을 수행한다.