-2

If I know I am on a little-endian machine, how can I convert the endiannes of a 14-bit bitfield?

struct {
    unsigned foo : 14, bar 2;
} baz;

I have a hunch that baz.foo = htons(baz.foo) will not work properly.

4

1 に答える 1

1

それを auint16_tと結合して貼り付け、代わりにそれを交換します。

于 2013-04-06T20:26:38.187 に答える