Created
December 25, 2011 18:49
-
-
Save mbroadst/1519605 to your computer and use it in GitHub Desktop.
This file contains 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 data = QByteArray::fromRawData(mydata, sizeof(mydata)).toHex(); | |
qDebug() << QString("0x%1").arg(data.at(0), 2, QLatin1Char('0')); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment