Why do you define true like #define TRUE (1==1) instead of just 1?

Asked 2 years ago, Updated 2 years ago, 70 views

I saw the C chord Why did they bother writing it like that instead of writing it as 1, 0? Is there anything better?

#define TRUE (1==1)
#define FALSE (!TRUE)

c precompiler

2022-09-22 22:20

1 Answers

Because writing like that is close to the actual definition of boolean type. It doesn't matter if you write 1/0

Never take off the brackets


2022-09-22 22:20

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.