Sure, you can look and see that the size() of a QByteArray returns
an 'int', but that is only as of today. You should get into the habit
of controlling the types written to QDataStreams.
Actually, for reading and writing binary data files, I think it is wise to get
into the habbit of using explicitly sized types. That is, write out and read
back a qint8, a qint32 or a qint64, not an int or a long. int and other integer
types are not guaranteed to be the same size across platforms, so you may get
into trouble if you are not explicit about how many bytes you want or expect
your values to be encoded in.


Yes. Even better.

André

_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest



_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to