There is no problem. QDataStream is outputting exactly what you asked it to. You have a 32-bit unsigned integer with the value 54 and you have asked for output in LittleEndian order. The integer is 4 bytes 0x00000036, and QDataStream outputs them in reverse order. You get 4 bytes in the file, the first is 54 decimal (0x36) followed by 3 zero bytes. Treated as text this is equivalent to the C string "6".Please let me know how to address this problem
Also look at QString::number(), QByteArray::number() etc.Qt Code:
const int num = 54; s << num; }To copy to clipboard, switch view to plain text mode
Bookmarks