i have a QByteArray variable like this:
QByteArray read= port->readAll();
now i want convert read to Array for write binary file like this:
int b[] = {}; // lengh of array is port->readAll() size
QFile myFile("e:/test/test.dat");
if(!myFile.open(QIODevice::WriteOnly))return;
myFile.write((char*)b,sizeof(int));
myFile.flush();
myFile.close();