QString 转化成unsigned char *


        UCHAR H2Buf[32];//32
        UCHAR KMBBuf[32];//32
        UCHAR *H2BufP = H2Buf;
        UCHAR *KMBBufP = KMBBuf;
        memset(H2Buf,0x0,sizeof (H2Buf));
        memset(KMBBuf,0x0,sizeof (KMBBuf));
    
        //QString 转化成unsigned char *
        QString h2_str="DEB83C112B07D4837D9D8DDF3F6955B6";
        std::string H2_String = h2_str.toStdString();
        H2BufP = const_cast<unsigned char *>((const unsigned char*)H2_String.c_str());
        memcpy(H2Buf,H2BufP,32);


        //QString 转化成unsigned char *
        QString kmbp_str="DEB83C112B07D4837D9D8DDF3F695566";
        std::string KMBP_String = kmbp_str.toStdString();
        KMBBufP = const_cast<unsigned char *>((const unsigned char*)KMBP_String.c_str());
        memcpy(KMBBuf,KMBBufP,32);

你可能感兴趣的:(QString 转化成unsigned char *)