What's wrong with
char nbuf[] = {65, 67, 66, '\0'};
CString msg(nbuf)
m_asciiresult.SetWindowText(msg);
?
[update]
Quote:
const unsigned char nbuf[] = { 'A', 'B', '\0', '\0', 'C', 'd', 'e', 'f' };
above the programs , vice virsa ...
I am trying with same way i didnt get if any changes let me know
Expecting output will be "65 66 0 0 67 100 101 102"
You may iteratively augment a CString object using the
CString::Format[
^] method, not terribly efficient, but it should work, e.g. (not tested)
CString msg;
for (size_t n=0; n < sizeof(nbuf); ++n)
{
CString s;
s.Format(_T("%u "), (unsigned) nbuf[n]);
msg += s;
}
[/update]