Reputation: 13
In Objective C if given that X is an Integer what does is ! X
Does it mean a user logical negation operator like Java, or if it has value 0
then X is non zero?
Upvotes: 0
Views: 37
Reputation: 112857
Objective-C is a strict superset of the "C" language so it behaves exactly the same as "C" (which it is). !
is the logical not operator.
int x = 3;
int y = ! x;
int z = ! y;
x: 3
y: 0
z: 1
Upvotes: 0
Reputation: 726479
Operator !
in Objective-C is the same as in C. It is a logical not operator, which operates on numbers.
1
Upvotes: 1