CString内容转为16进制unsigned char

    CString m_Send="000A115033AA";

    char/*wchar_t*/ *stops, s[3];
    unsigned char  uc;     
    for (size_t i = 0; i < 10; i++)
    {
        s[0] = m_Send.GetAt(i * 2);
        s[1] = m_Send.GetAt(i * 2 + 1);
        s[2] = 0x0;
        uc = (unsigned char)strtoul/*wcstoul*/(s, &stops, 16);
    }

 

posted @ 2022-04-14 13:55  ericdm  阅读(568)  评论(0编辑  收藏  举报