I have a C structure that contains several int data types; I shift and mask the data types in this structure to produce 73 bits of ordered data. I need to write many lines of these 73 bits into a txt file in format "0x73bits" using fprintf.
It must be exactly 73 bits of data every time in just a few lines of code. I can do this using 64 bits then playing around with 9 bits. But it is messy.
Can anyone suggest a more clean professional method?