[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
== Equality operator
exp1 == exp2 Test for exp1 equal to exp2
exp1, exp2 any expression
== is a relational operator, yielding a value of either TRUE, if the
expressions have the same value; or FALSE if the expressions do not
have the same value. For string or regular expression operands, the
strings are compared according to the collating sequence. Here is an
example:
if ( number == guess )
...
do {
...
} while ( ans == 'y' );
!= Inequality operator (Not Equal)
exp1 != exp2 Test for exp1 not equal to exp2
exp1, exp2 any expression
!= is a relational operator, yielding a value of TRUE if exp1 has a
different value than exp2; or FALSE if exp1 has the same value as exp2.
For string operands, the strings are compared according to the
collating sequence. Example:
if ( number != guess )
...
do {
...
} while ( ans != 'n' );
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson