Can we declare a function like this in c++:
int operator + (int , int);
Your answers will be appreciated!
Thanks
The two member access operators, operator->() and operator->*() can be overloaded. The most common use of overloading these operators is with defining expression template classes, which is not a common programming technique.
(::) Scope resolution operator cannot be overloaded in C language.
Can we overload all operators? Almost all operators can be overloaded except a few.
You cannot redefine a built-in operator. Operator overloading is designed to allow you to extend the language, not to change it. At least one of the parameters of an overloaded operator must be a user defined type (class or enum type) or a reference to a user defined type.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With