且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

怎么把QByteArrray转换成BYTE *?

更新时间:2023-02-19 13:50:30

您可以出于此目的使用data成员(尽管获取用于写访问的缓冲区)真的是个坏主意):

You may use the data member for the purpose (though getting the buffer for write access is really a bad idea):

QByteArray array;
//..
BYTE * pByte = reinterpret_cast<byte*>(array.data());