RT

解决方案 »

  1.   

    CString CSegInfo::algorismtohex(int algorism)//十六进制转换
    {
    CString str;
    switch(algorism)
    {
    case 10:
    str="A";
    break;
    case 11:
    str="B";
    break;
    case 12:
    str="C";
    break;
    case 13:
    str="D";
    break;
    case 14:
    str="E";
    break;
    case 15:
    str="F";
    break;
    default:
    str.Format("%d",algorism);
    }
    return str;
    }
      

  2.   

    用VC函数:
     char *hexbuff="0x40AB";
       char *endp;
       int m=strtol(hexbuff,&endp,16);
       char binbuf[32];
       itoa(m,binbuf,2);
       MessageBox(binbuf);