QFile f(fileName); f.open(QIODevice::ReadOnly); fileData = f.readAll(); f.close(); bool ok; qDebug() << fileData.mid(0,2).toShort(&ok,16) << " " << ok;
short dest;qstrncpy((char *)&dest, fileData.mid(0,2).data(), sizeof(dest));
C++ (Qt)QFile f(fileName);f.open(QIODevice::ReadOnly);short val;f.read((char*)&val, sizeof(val));f.close();