Quick Question

is there a difference between writing out

if (v_var == TRUE) or if (v_var == FALSE)

vs

if (v_var) or if (!v_var)

or is personal preference?
There is no true or false in C.
So in order to make the code clearer they wrote those as macros (in upper-case). That may allow you to change their representation.

As for C++, I would consider a conceptual error to write var == true.

But yes, they are different. By instance
1
2
3
int answer = 42;
if(answer) //true
if(answer==true) //false 
i just did #define false 0 and #define true 1 and then put it into a header
ty
Topic archived. No new replies allowed.