Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Bit fields? (Assuming one's not using a struct)




Good point. Yes if we need more than 8 flags we might need to consider one of the fixed length types.

Why 8? Some computers have smaller types. C has smaller types, as bitfields, but they're second–class. Why not just always specify the bits you need?

If you think 16 is probably enough and don't want to calculate, then specify 16.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: