On 12/24/2010 04:20 AM, ext Akos Zalavary wrote:
> Hi,
>
> Is there an easier solution for this?
>
> E.g. checking the size of struct in bytes and force reading the same
> amount of data into that from the file...
>
> Thanks!
>
> typedefstruct_Sl_based_funct_t{
>
> /* byte*/ unsigned hypo_lac : 1;
>
> /* byte*/ unsigned page_prev : 1;
>
> /* byte*/ unsigned camel_prev : 1;
>
> /* byte*/ unsigned isp : 1;
>
> /* byte*/ unsigned emlpp_prev : 1;
>
> /* byte*/ unsigned ded_page_rnc : 1;
>
> /* byte*/ unsigned spare4 : 1;
>
> /* byte*/ unsigned spare5 : 1;
>
> } l_based_funct_t ;
>
>
> ...and reading one quint8 into it.
<cough>qt-interest</cough>
Anyway, what's wrong with this:
l_based_funct_t var;
file.read(reinterpret_cast<char *>(&var), sizeof var);
Christian
_______________________________________________
Qt-creator mailing list
[email protected]
http://lists.qt.nokia.com/mailman/listinfo/qt-creator