olosie
4th March 2010, 11:51
I want read binary file and load data to unsigned char array. My code is:
QFile f("a.a");
f.open(QFile::ReadOnly);
QByteArray d = f.readAll();
f.close();
Functions from QFile and QByteArray support only signed char not unsigned char. I can not understand reason for using signed char because for me byte=unsigned char.
Is there any possibility to read unsigned char from file? Of course I can convert every signed char to unsigned char but mayby exsist easier way for this problem?
QFile f("a.a");
f.open(QFile::ReadOnly);
QByteArray d = f.readAll();
f.close();
Functions from QFile and QByteArray support only signed char not unsigned char. I can not understand reason for using signed char because for me byte=unsigned char.
Is there any possibility to read unsigned char from file? Of course I can convert every signed char to unsigned char but mayby exsist easier way for this problem?