Does C have booleans?

In C99, we have the header stdbool.h. The important contents are:

#define bool _Bool
#define true 1
#define false 0

The true and false are simple, but what is this _Bool? It’s a reserved keyword, and a type much like int, etc.

Tagged #c, #programming.

Similar posts

More by Jim

Want to build a fantastic product using LLMs? I work at Granola where we're building the future IDE for knowledge work. Come and work with us! Read more or get in touch!

This page copyright James Fisher 2016. Content is not associated with my employer. Found an error? Edit this page.