Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on How to save multiple numbers into one byte. Parent comment
Packing may be performed automatically, unfortunately in an implementation specific way.
In C, you can also specify the size of your fields within integer types:
struct{ unsigned char lowByte:3, midByte:3, highByteLowBits:2; };
And unfortunately too, the actual layour depends on the implementation.
So in most cases, you still have to implement bit shuffling yourself to produce the exact layout that is needed for external files.
There are no comments on this comment yet.
Packing may be performed automatically, unfortunately in an implementation specific way.
In C, you can also specify the size of your fields within integer types:
struct{ unsigned char lowByte:3, midByte:3, highByteLowBits:2; };
And unfortunately too, the actual layour depends on the implementation.
So in most cases, you still have to implement bit shuffling yourself to produce the exact layout that is needed for external files.