Physics, asked by neelakshi8884, 1 year ago

What is operator overloading? List the rules for operator overloading.

Answers

Answered by manojsah7631
1

Rules for operator overloading

In C++, following are the general rules for operator overloading.

1) Only built-in operators can be overloaded. New operators can not be created.

2) Arity of the operators cannot be changed.

3) Precedence and associativity of the operators cannot be changed.

4) Overloaded operators cannot have default arguments except the function call operator () which can have default arguments.

5) Operators cannot be overloaded for built in types only. At least one operand must be used defined type.

6) Assignment (=), subscript ([]), function call (“()”), and member selection (->) operators must be defined as member functions

7) Except the operators specified in point 6, all other operators can be either member functions or a non member functions.

8 ) Some operators like (assignment)=, (address)& and comma (,) are by default overloaded.

Answered by Anonymous
0

━━━━━━━━━━━━━━━━━━━━━━━━━

\bf\Huge\red{\mid{\overline{\underline{ ANSWER }}}\mid }

━━━━━━━━━━━━━━━━━━━━━━━━━

\Large\fbox{\color{purple}{QUESTION}}

Overloading

━━━━━━━━━━━━━━━━━━━━━━━━━

\Large\fbox{\color{purple}{ SOLUTION }}

\Huge\mathfrak\pink{OVERLOADING}

overloading is a condition in which the high current flows through the circuit and at the same time too many appliances are switched on then the total current drawn through the circuit may exceed its rated value.

and condition when the live wire comes in contact with the neutral wire due to which a high current flows in a circuit

━━━━━━━━━━━━━━━━━━━━━━━━━

\bf\Large\red{ THANKS \: FOR \: YOUR}

\bf\Large\red{ QUESTION \: HOPE \: IT  }

\bf\Large\red{ HELPS  }

\Large\mathcal\green{FOLLOW \: ME}

━━━━━━━━━━━━━━━━━━━━━━━━━

Similar questions