_Bool in C 👨💻
Do we have BOOL in C ?
We do have! and it is widely used in modern embedded projects for better readability, btw many low-level codes still use 0/1 instead of BOOL due to older compiler support, or coding standards.
Since C99:
#cprogramming #notes #boolean @tcafeLinux
Do we have BOOL in C ?
We do have! and it is widely used in modern embedded projects for better readability, btw many low-level codes still use 0/1 instead of BOOL due to older compiler support, or coding standards.
Since C99:
#include <stdbool.h>
bool flag = false;
if (!flag) {...}
bool is a MACRO for _Bool
You can also use _Bool like this:
_Bool flag = false;
#cprogramming #notes #boolean @tcafeLinux
Please open Telegram to view this post
VIEW IN TELEGRAM