如何把一个字符串或一个二进制字串转换为:由0到9,A到Z这些字符表示

解决方案 »

  1.   

    CString strText(_T("Hello,World"));
    CString strMsg(_T(""));
    for(int i=0; i<strText.GetLength(); i++)
    {
    CString strTmp;
    strTmp.Format(_T("0x%x "), strText.GetAt(i));
    strMsg += strTmp;
    }
    AfxMessageBox(strMsg);
    this???
      

  2.   

    [font=Courier New][size=3]CString strText(_T("Hello,World"));
    CString strMsg(_T(""));
    for (int i = 0; i < strText.GetLength(); i++)
    {
        CString strTmp;
        strTmp.Format(_T("0x%x "), strText.GetAt(i));
        strMsg += strTmp;
    }
    AfxMessageBox(strMsg);[/size][/font]是不是LS讲的这个呢?
      

  3.   

    strotol比如: CString strTemp = "0x22ff";WORD wTemp = strtol(strTemp, NULL, 16);