如何用MessageBox显示unsigned char?

解决方案 »

  1.   

    使用:CString str;来进行转换
    char dd[]="dddd";
    str.Format("%s",dd);
    MessageBox(str);
      

  2.   

    unsigned char c1;
    CString s1;
    c1='0';
    s1.Format("%s",c1);  ------出现错误,不知为何?!
    MessageBox......
      

  3.   

    不知道你想用什么方式看。unsigned char p[20];
    _mbscpy(p,"this");
    char ss[128];
    sprintf(ss,"HEX:%x\nStr:%s\nValue:%d",p,(char*)p,p);
    MessageBox(NULL,p,"内容",MB_OK);
      

  4.   

    s1.Format("%s",c1);  ------出现错误,不知为何?!
    s1.Format("%c",cl);  ---ok
      

  5.   

    强制转换不行么?
    unsigned char str;
    MessageBox((CString)str);