- 2
What is not equal to sign
.
3 Answers
+ 22
!=
+ 9
Both the ! and the != represent a logical *not* notation. for example:
size_t x = 2
if (!x) {
//do something
} else if ((x -1) != 2) {
//do something
} else {
return(0);
}
if you have anything that isn't x (2), then it will proceed with the first block, otherwise it will go to the next if statement and be evaluated if it is not 2 then it will do that block (since it past the first if, that block will not get triggered this iteration). and then if neither of those it will go to the last if statement.
- 1
it's simple !=