I want to read hex data from a QTextStream
This program outputsCode:
#include <QTextStream> int main(int, char**) { in.setIntegerBase(16); QString str1, str2; unsigned int val1; in >> str1 >> val1 >> str2; qDebug("%s %x %s", qPrintable(str1), val1, qPrintable(str2)); return 0; }
I thought that setIntegerBase(16) tells the stream to expect hex input when reading integers. The read stops on the character C, whic becomes p[art of a following string.Code:
hexvalue 0 C00
Can I read a hex value without reading a string and then converting and without a 0x prefix ?
All ideas welcome
Enno