The logical-negation (logical-NOT) operator produces the value 0 if its operand is true (nonzero) and the value 1 if its operand is false (0). The result has int type. The operand must be an integral, floating, or pointer value.
For more information, see logical-AND and logical-OR.
Example
In the following example, the variable EndOfJob
is tested. If the value is 0, the condition is logically negated to become true (nonzero). If the value is 1, the condition is logically negated to become false (zero).
// Example of the logical-NOT operator
int EndOfJob = 0; // 0 = not end of job, 1 = yes, end of job
if (!EndOfJob) {
printf( "It's still not the end of job!");
}