What is operator overloading? Give Example

Answer Posted / xxxx

A single operator is used to perform diff fuction in a
program is known as operator overloading..
Operator overloading is an operator that perform different
task based on given arguments.
e.g. suppose '+' is an operator is used to add two number
and if we use '+' with two strings then operator '+' can
concate two string is known as operator overloading.

or

operator overloading means one operator can perform multiple
operation based on given arguments.

Is This Answer Correct ?    3 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

to find out the minimum of two integer number of two different classes using friend function

1635


Write a program to sort the number with different sorts in one program ??

1910


What is encapsulation c#?

598


Is enum a class?

600


Is abstract thinking intelligence?

588






class type to basic type conversion

1833


What is advantage of inheritance?

685


Why is abstraction needed?

561


What is debug class?what is trace class? What differences are between them? With examples.

1598


Following are the class specifications: class {int a}; class {int b}; Using friend funtion,calculate the max of two objects and display it.

2000


what's the basic's in dot net

1732


What is abstraction in oops with example?

765


Which is better struts or spring?

612


There are two base class B1,B2 and there is one class D which is derived from both classes, Explain the flow of calling constructors and destructors when an object of derived class is instantiated.

1448


They started with the brief introduction followed by few basic C++ questions on polumorphism, inheritance and then virtual functions. What is polymorphims? How you will access polymorphic functions in C? How virtual function mechanism works?

1403