QByteArray resize/sizeof problem.
I have a problem.
out << sizeof(arr);
I receive 4. why?
QByteArray adds \0 to your data. Sizeof might miss that. Or it reports something completely different. Use QByteArray::size() instead.
The sizeof() a QByteArray object has nothing to do with the amount of data the object manages. It is the size of the object member variables used to track the array content. QByteArray operates a private implementation object and likely only contains a 4 byte pointer to that private object; hence the reported size.
sierdzio has the function that reports the amount of data in the QByteArray.