The Assignment Operators
Now it is time for us to move on to the third operator that works well in the C++ language.
This category is going to be the assignment operator.
This is going to be the most common out of the operators in order to make your codes work well, and it is often used to help assign the value over to the variable so that it works properly.
This assignment operator is going to be important because it is going to be responsible for helping make it easier to assign a value or a name to your variable.
It is also a good option to use when it comes to saving, searching, and so much more inside of any of the codes that you are working on.
Some of the other types of assignment operators that we are able to work with, outside of the equal sign to give a value to the variable will include some of the following:
It is going to assign the value of the operand on the right hand to the one that is on the left.
It is going to add together the values from both operands and then assigns the sum of these over to the operand on the left side.
It is going to multiply both of the operands and then give the results over to the operand on the left side.
It is going to divide the value that is on the left side from the one on the right side and then assigns this amount to the left side.
One of the things that we need to take a look at here is how the assignment operators are going to show up in a lot of the codes that we want to use in C++.
There are some that we will use on a regular basis, like the equal sign working with our variables and assigning a value over to them.
And then there are going to be some of the options above that are not that common, and it is likely that you are not going to use them until you advance up in your coding quite a bit .
Most of the time, though, the assignment operator that you are going to work with is the equal sign.
This gives us a chance to assign the right value over the variable that we want to work with, but there can be times when we would like to add in some of the other assignment operators to help move our code along.