0
How on Earth do you overload operators in C++?
I simply don't understand operator overloading, and I need it for Part 2 of the C++ course's code project. Could anyone explain it?
5 Respuestas
0
before understanding operator overloading, you first need to understand the concept of overloading. So do you know what exactly overloading is?
0
That wasn't explained in the lesson about it.
0
MattMad, in introduction to C++, they explain operator overloading in the best way possible, firstly checkout this and if you face any problem so feel free to ask for help from me or other fellow coders
https://www.sololearn.com/learn/courses/c-plus-plus-introduction
0
Alhaaz
I was referring to the one in the C++ intermediate — and I just revised the lesson on overloading in the C++ Introduction course
0
Overloading needed when we need to do something with non basic data types. For example your class contains ints chars or any other variables(members), than if you want to add data to object of your class with +/- operator they should be determined for your class to do right things with right members of class. Or if you use + operator to sum two objects of one class, program should know how that two objects summs - what members will change. For example no one of two objects changes but console outputs some message.