Why not use: x = !x;?

Yes, that is how the abominable '!!x' came to be - converting any non-zero value to a 1.

1 Like