Computer Science, asked by Nitesh09, 1 year ago

What is operator overloading? Explain how to write binary operator overloading with example.

Answers

Answered by deepa70
0
Hii machiii ✋...



➡️ Operator overloading (less commonly known as ad-hoc polymorphism) is a specific case of polymorphism (part of the OO nature of the language) in which some or all operators like +, = or == are treated as polymorphic functions and as such have different behaviors depending on the types of its arguments.

➡️ Operator overloading allows you to redefine the way operator works for user-defined types only (objects, structures). It cannot be used for built-in types (int, float, char etc.).

➡️ Two operators = and & are already overloaded by default in C++. For example: To copy objects of same class, you can directly use = operator.

➡️ Function overloading (also method overloading) is a programming concept that allows programmers to define two or more functions with the same name and in the same scope.

➡️ Each function has a unique signature (or header), which is derived from: function/procedure name. number of arguments. arguments' type
Answered by 0xXIshuRajputXx0
0

Answer:

It will be the sum of the currents drawn by the devices and can be greater than what is safe , This condition is called an overload .

Explanation:

Similar questions