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

Can a copy constructor admit an object of the similar class , Can a copy co...

Can a copy constructor admit an object of the similar class as parameter, rather than reference of the object?

Modified distribution method for solving transportation prob, i want a c or...

i want a c or c++ code for solving transportation problem using modified distribution method

Padovan string , write a program that counts the number of occurences of th...

write a program that counts the number of occurences of the string in the n-th Padovan string P(n) program in java // aakash , suraj , prem sasi kumar kamaraj college progr

C program for string operations, Aim: To implement a program for following...

Aim: To implement a program for following string operations: Length of String. String Concatenation. Substring (provide start index and length) Find character a

Write a program that finds the minimum total number of shelv, At a shop of ...

At a shop of marbles, packs of marbles are prepared. Packets are named A, B, C, D, E …….. All packets are kept in a VERTICAL SHELF in random order. Any numbers of packets with thes

Give a formal expression of the specification, A function REPAT is specifie...

A function REPAT is specified below. Function REPAT(c in Char, i in Int, s in mString) return in mString pre 1 ≤ i ≤ the length of s. post The returned value is a string identic

#, YOU HAVE GIVEN THE MARKED UP PRICE OF 80% AND DISCOUNT PRICE OF 10% THEN...

YOU HAVE GIVEN THE MARKED UP PRICE OF 80% AND DISCOUNT PRICE OF 10% THEN FIND THE SELLING PRICE

What is a conversion constructor c++, A constructor that accepts one argume...

A constructor that accepts one argument of a dissimilar type.

Decode the code, Smugglers are becoming very smart day by day. Now they hav...

Smugglers are becoming very smart day by day. Now they have developed a new technique of sending their messages from one smuggler to another. In their new technology, they are send

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