Start here · Essential guide
Comparison Operators in C++
Learn C++ comparison operators: ==, !=, <, >, <= and >=, how they return bool, common mistakes, and how to compare strings and floating-point numbers safely.
Syntax and Functions
The operators that compare values in C++ and how logical OR fits in.
Start here · Essential guide
Learn C++ comparison operators: ==, !=, <, >, <= and >=, how they return bool, common mistakes, and how to compare strings and floating-point numbers safely.
Comparison operators compare two values in C and C++: ==, !=, <, >, <= and >=. Each one returns true or false, with a short example for each one.
In C, || is the logical OR operator. It gives 1 when at least one side is true, and it skips the right side when the left side is already true.
Related topics