Explain operator overloading fundamentals, C/C++ Programming

Assignment Help:

Operator Overloading Fundamentals

The C language uses the concept of Operator Overloading

discreetly. The asterisk (*) is used as multiplication operator as well as indirection (pointer) operator. The ampersand (&) is used as address operator and also as the bitwise logical 'AND' operator. The compiler decides what operation is to be performed by the context in which the operator is used.

Therefore, the C language has been using Operator Overloading internally. Now, C++ has made this facility public. C++ can overload existing operators with some other operations. If the operator is not used in the context as explained by the language, then the overloaded operation, if explained will be carried out.

For example, in the statement

                x = y + z;

If x, y and z are integer variables, then the compiler knows the operation to be performed. But, if they are objects of some class, then the compiler will carry out the instructions, which will be written for that operator in the class.

 


Related Discussions:- Explain operator overloading fundamentals

Hw8, Asks the user for an integer. if the number is less than 21, ask them ...

Asks the user for an integer. if the number is less than 21, ask them for a number again; repeat this until you get a number bigger than 20. 20 is not an acceptable number. Once yo

Explain relational operators, Relational Operators A relational operato...

Relational Operators A relational operator is used to make comparison among two values. All these operators are binary and needs two operands. There are the following relationa

Big M method, I Want a answer for solving the big M method in the topic of ...

I Want a answer for solving the big M method in the topic of simplex method...

Explalin concept of derivations in c++, derivations 1. Regardless of the...

derivations 1. Regardless of the type of derivation, private members are inherited by the derived class, but cannot be accessed by the new member function of the derived class,

Fibonacci series, draw the flow chart to print the fibonacci series upto n ...

draw the flow chart to print the fibonacci series upto n th terms

Compiler design limiting instruction, Ravi is a newbie to the programming a...

Ravi is a newbie to the programming and while learning the programming language he came to know the following rules: · Each program must start with ''{'' and end with '

Asset pricing project, In the final project assignment you are asked to dev...

In the final project assignment you are asked to develop an OOP C++ class hierarchy for derivative pricing, using the binomial tree and Black-Scholes option pricing methods. You wi

Develop online slot video game for facebook, Develop Online Slot Video Game...

Develop Online Slot Video Game for Facebook Prepare an online slot video game for a Facebook promotion in order to draw new visits and Increase the number of "likes" of the Face

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd