BYTE byteArray[100]; // with some values CString strByte; for ( int i = 0; i < 64; i++ ) { strByte.Format( "%02x", byteArray[i]); // output the string }