Created
December 25, 2011 18:43
-
-
Save ynonp/1519597 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <QtCore/QtCore> | |
#include <QtCore/QCoreApplication> | |
#include <QtCore/QByteArray> | |
#include <QtCore/QDebug> | |
#include <QtCore/QLatin1Char> | |
int main(int argc, char **argv) | |
{ | |
QCoreApplication app(argc, argv); | |
static const char mydata[] = { | |
0xc7, 0xcc, 0x3e, 0x0b, 0x00 | |
}; | |
QByteArray arr = QByteArray::fromRawData(mydata, sizeof(mydata)); | |
qDebug() << arr.toHex(); | |
qDebug() << QString("0x%1").arg(arr.at(0), 2, 16, QLatin1Char('0')); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment