Re: !!, what is it?



bjk of course ha scritto:
hello,

I've stumbled upon this in some code:

n = !!x;

I've ran it and 'n' is always either 0 or 1. Is '!!' an operator (what's it
called?) and is it standard/portable?


It means 'not not x', evaluating to 0 if x is 0 or to 1 if x is not 0.

--
Devaraja (Xdevaraja87^gmail^c0mX)
Linux Registerd User #338167
http://counter.li.org
.