The next thing on the list that we need to take a look at is going to be the relational operators.
These are going to be a slightly different thing than what we have done with some of the other options, but they will ensure that we are able to check out a few of the different options that we are able to handle along the way.
Some of the options that you can work with when it comes to the relational operators include:
- (==): this is the operator that is going to check the equality of your two operands.
If they are equal, the conditions will be true.
- (>): this operator is going to check the value of your operands.
If the operand on the left side is higher than the one on the right, the condition will be true.
- (<): this operator is basically the opposite of the one above.
If you find that the value of your operand on the left side is greater than the one on the right side, the condition will be true.
- (!=): this one is going to check the equality of your two operands.
If the values are unequal, your condition is true.
- (<=): this operator is going to check whether the operand on the left side is less than or equal to the operand on the right side.
If it meets these criteria, the condition is true.
- (>=): this one is going to check if the value of the operand on the left side is greater or equal to the one on the right side.
If it is true, the condition is true.
As we can see, there are a number of C++ operators that we are able to work with.
All of them are going to work in a different manner, but you will find that these things inside of the code and can make the code more powerful to work with overall.
They may seem like a really simple addition to the code that you are working with, but they are really going to make a big difference to the codes that you are using.