Introduction to C++
The assignment operator (
It works exactly the same with the
string data type:
The equality (
==) and inequality (
!=) operators are used to numerically compare 2 variables:
Why 1 and 0? This is another method of using the
var == 9 equals
true) if var numerically equals the number 9.
var == -9 equals
false) if var is not numerically equal to the number 9.
The inequality operator is doing exactly the opposite: