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

Like, say I have a data structure that is four bits wide (consisting of a couple of flags or something) and I want to make an array of them and access them randomly. What help do I get from C to do this? C says "fuck you".


Pick an appropriate base type (uintN_t) for a bitset, make an array of those (K * N/4) and write a couple inline functions or macros to set and clear those bits.


Only if you don't know C.

Otherwise is says, do whatever you feel like.




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

Search: