r/ProgrammerHumor • • Nov 30 '19

C++ Cheater

Post image
79.3k Upvotes

1.0k comments sorted by

View all comments

Show parent comments

6

u/[deleted] Nov 30 '19
if( (isEven  =!  (num & 1)) )
;

4

u/ChronosSk Nov 30 '19

That... could have better whitespace. Good to have the extra parentheses, though.

3

u/[deleted] Nov 30 '19

(Almost) Everything you see was required to avoid warnings in the compiler

3

u/ChronosSk Nov 30 '19

Oh, well, shows what I know. :)

1

u/ender1200 Dec 01 '19
bool isEven = (bool)(num & 1);

0

u/[deleted] Nov 30 '19

[deleted]

2

u/[deleted] Nov 30 '19

Works as intended