How to convert unsigned array to char in QByteArray in Qt?

unsigned char x [] = {0x7E, 0x00,0x00,0x0F};

I want to click on QByteArray, but QByteArray, when it finds '\ 0', stops copying.

+6
source share
2 answers

What version of Qt are you using? 4.7 has QByteArray(const char*, size) , which should work, and QByteArray::fromRawData(const char*, int size) , which should also work.

+11
source

QByteArray test ("\ xa4 \ x00 \ x00", 3);

0
source

Source: https://habr.com/ru/post/887443/


All Articles