NeoMulti

블로그 이미지
by 사힐
  • Total hit
  • Today hit
  • Yesterday hit

CString -> char*

CString str = _T("권오철");
char *buffer = new char[str.GetLength()];

strcpy(buffer,CT2A(str));
buffer;

 

delete buffer;



 

String -> char*

char ch[100];

strcpy(ch,(LPSTR)(LPCTSTR)"나는 누구인가?");

 

CString -> BYTE

BYTE msgProxy.byData;

CString strText = _T("ㅇㅇㅇ");

memcpy(msgProxy.byData,T2CA(strText), nLen);

 

BYTE byBuffer[100];

CString strText = _T("DDD");

strcpy((LPSTR)byBuffer,T2CA(strText));
  m_SocketManager.WriteComm( byBuffer, nLen, INFINITE);

 

char * -> CString

CString str = (LPCTSTR)(LPSTR)char *  // 이방법은 좋지 않다 .. 글씨가 깨진다

 

char getMessage[100] = "나는 천재인가";
 CString strMessage;
 strMessage.Format(_T("%s"),CA2T(getMessage));

AND

ARTICLE CATEGORY

분류 전체보기 (26)
Imagine cup 2007 (2)
What (23)
영화 (1)

RECENT ARTICLE

RECENT COMMENT

RECENT TRACKBACK

CALENDAR

«   2025/04   »
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30

ARCHIVE