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

I need some context… why?


It says it right there:

"Note: The ByteBool, WordBool, and LongBool types exist to provide compatibility with other languages and operating system libraries."


Turns out that old versions of Visual C++ used their own typedef of bool as int: https://stackoverflow.com/questions/4897844/is-sizeofbool-de...


There were risc platforms with int sized bool, usually where one byte math wasn't in the instruction set.


In C, sizeof(bool) is implementation specific. Typical values are sizeof(char) and sizeof(int).


In case you need a lot more than two boolean values some day.




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

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

Search: