![]() ![]() They must have a return type, and parameters are always optional (as per their requirements). *overloading + for class type object*/Īs I already mentioned, overloaded operators are just a special type of functions. Overloaded operators are just functions (but of a special type) with a special keyword operator followed by the symbol of the operator to be overloaded. ![]() So operator overloading lets us define the meaning of an existing operator (note that you cannot overload some operators) for the operands of a user defined type (for example, a class is a user defined type). If you wished to create new operator like ** for exponential purposes, you couldn't do it. So, basically what I mean is you cannot redefine an operator and you can't create a new operator, either.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |