Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
SV_BubbleTime
on Nov 29, 2020
|
parent
|
context
|
favorite
| on:
What is your favorite C programming trick? (2009)
I don’t get it, and tried to look it up without success. The only way I get it is if it also reverses logic was a 0 start value becomes true. But how is this different from !x ?
saagarjha
on Nov 29, 2020
[–]
!!x gives you 0 if x is zero and 1 if x is anything else. !x gives you 1 if x is zero and 0 if x is anything else.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: