I encountered the below code in C program.
int a = !! b ;
variable b is also an integer. Initially I thought it is 'not' operator with a typo :)
Can someone help in explaining this?
I encountered the below code in C program.
int a = !! b ;
variable b is also an integer. Initially I thought it is 'not' operator with a typo :)
Can someone help in explaining this?
This is operator !
, which is used twice in row. If b
is non-zero, a
gets value 1, and if b
is zero, a
gets value 0.