04-08-2017 10:00 AM
You can try stdbool.h library as true or false values with bool variables. Some compiler supports this library.Or
Define true 1
define false 0
04-08-2017 10:08 AM
@sai_shashi not sure if bool has been added to C but you can just use it with C++.
Anyway most processors have no bit support so a bool has to map to char. You can just do this:
typedef unsigned char bool;
const bool TRUE = 1;
const bool FALSE = 0;
07-12-2018 06:26 AM
C99 introduced _Bool to represent Boolean truth variables
_Bool is actually an unsigned integer type
true is coded as '1', false is coded as '0'
C99 also added 'stdbool.h' , if you include this header file, you can use :
most people use 'bool' instead of _Bool
if you check the stdbool.h in SDK :
so ... just include 'stdbool.h'