Return Types of Operators

Learn about the return types of operators.

We'll cover the following

When overloading an operator, it is advisable to observe the return type of the same operator on fundamental types. This will help in making sense of the code and reducing confusion.

None of the operators on fundamental types return void. This fact should be obvious for some operators. For example, the result of adding two int values as a + b is int:

Get hands-on with 1200+ tech skills courses.