+ 4

Is this related to booleans?

#include <iostream> using namespace std; #define h(x)(x||0) int main() { cout<<h(1); return 0; } I read somewhere that 1 is taken as true and 0 as false

8th Mar 2017, 8:52 AM
Prabhakar Dev
Prabhakar Dev - avatar
3 ответов
+ 5
True at Norbivar and one more thing "null is false"
9th Mar 2017, 6:48 AM
Yanothai Chaitawat
Yanothai Chaitawat - avatar
+ 3
0 and 1 was related to boolean. Yes right generous! :V
8th Mar 2017, 9:06 AM
Yanothai Chaitawat
Yanothai Chaitawat - avatar
0
Actually : 0 is false, and EVERYTHING ELSE is true.
8th Mar 2017, 11:21 AM
Norbivar
Norbivar - avatar