Skip to content

Instantly share code, notes, and snippets.

@mbroadst
Created December 25, 2011 18:49
Show Gist options
  • Save mbroadst/1519605 to your computer and use it in GitHub Desktop.
Save mbroadst/1519605 to your computer and use it in GitHub Desktop.
#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