Quantcast
Channel: User Peter - Reinstate Monica - Stack Overflow
Viewing all articles
Browse latest Browse all 239

Comment by Peter - Reinstate Monica on How do I fix this 5-bit boundary based union in C?

$
0
0
While they are non-portable, they are designed exactly for the OP's purpose: Fit data into an externally imposed format. To this end, it is specified that the bit fields are adjacent; IIUC, the main issue are bit/byte order issues, to which code needs to cater which is aimed at more than one platform. But your suggestion is pointless: If you do the hand-packing, there is no need for the bit-fields any longer.

Viewing all articles
Browse latest Browse all 239

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>