Oh come on... C has a (very basic) bool type since C99:
bool
#include <stdbool.h> #include <stdio.h> int main(void) { bool a = true; bool b = false; if (a && !b) puts("hello, bool in C99"); }
; )
hmm interesting, should've checked the content of stdbool
No, the actual Boolean type in C is spelled _Bool. You can use that without including any header. stdbool.h simply defines the macros:
_Bool
stdbool.h
#define bool _Bool #define false 0 #define true 1
as a convenience.
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Oh come on... C has a (very basic)
bool
type since C99:; )
hmm interesting, should've checked the content of stdbool
No, the actual Boolean type in C is spelled
_Bool
. You can use that without including any header.stdbool.h
simply defines the macros:as a convenience.