2010-09-15 29 views

回答

4

试试这个 - 为如: - 如果 'x' 为您的字节数组,然后 -

BYTE x[5]; 
x[0] = 'A'; 
x[1] = 0; 
x[2] = 'B'; 
x[3] = 'C'; 
x[4] = 0; 

CString str((LPCSTR) &x, sizeof(x)); 
0
BYTE x[5]; x[0] = 'A'; x[1] = 'B'; x[2] = 'C'; x[3] = 'D'; x[4] = '0'; 

CString str = TEXT(""); 
CString s; 
for(int i=0;i<5;i++) 
{ 
    str.Format(L"%C",x[i]); 
    s += str; 
} 

AfxMessageBox(s);