What is operator overloading? Give Example

Answers were Sorted based on User's Feedback



What is operator overloading? Give Example..

Answer / palsaniya sadikhasan, meta.

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 ?    39 Yes 2 No

What is operator overloading? Give Example..

Answer / riya piyush jain

Operator overloading (less commonly known as operator ad-
hoc polymorphism) is a specific case of polymorphism in
which some or all of operators like +, =, or == have
different implementations depending on the types of their
arguments. Sometimes the overloadings are defined by the
language; sometimes the programmer can implement support
for new types.

Is This Answer Correct ?    23 Yes 1 No

What is operator overloading? Give Example..

Answer / sagar kelkar

it may be defined as an operator performing different
operations.for ex-arithmetic operators such
as(+,-,*,/,++,--) etc..

Is This Answer Correct ?    22 Yes 8 No

What is operator overloading? Give Example..

Answer / msn

Making an operator doing different operation other than
the normal one is termed as operator overloading..

Say for example Operator + is normally used to add numbers
but we can add another function concatenate two strings

Is This Answer Correct ?    9 Yes 0 No

What is operator overloading? Give Example..

Answer / selva

operator performing different task based on argument supplied.

Is This Answer Correct ?    4 Yes 0 No

What is operator overloading? Give Example..

Answer / karthik

A single operator is used to perform diff fuction in a
program is known as operator overloading..

Is This Answer Correct ?    4 Yes 2 No

What is operator overloading? Give Example..

Answer / 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

What is operator overloading? Give Example..

Answer / mohd nadeem

operator overloading provides special meaning to predefined operators with respect to user defined data types like class, struct, enum.

Is This Answer Correct ?    1 Yes 0 No

What is operator overloading? Give Example..

Answer / karthika

usually operators dealing with basic data types,operator
overloading allows the users to give additional meaning to
most operators so that it can be used with user's own data
types.

Is This Answer Correct ?    0 Yes 0 No

What is operator overloading? Give Example..

Answer / kalai391989

operator overloading is a function..

Is This Answer Correct ?    1 Yes 4 No

Post New Answer

More OOPS Interview Questions

why freind function takes more parameter than normal member function in c++?

1 Answers   IBM,


What language is oop?

0 Answers  


What is function overloading and operator overloading?

4 Answers  


#include <stdio.h> #include <alloc.h> #include <stdlib.h> #include <conio.h> void insert(struct btreenode **, int); void inorder(struct btreenode *); struct btreenode { struct btreenode *leftchild; struct btreenode *rightchild; int data; }; main() { struct btreenode *bt; bt=(struct btreenode *)NULL; int req,i=1,num; clrscr(); printf("Enter number of nodes"); scanf("%d",&req); while(i<=req) { printf("Enter element"); scanf("%d",&num); insert(&bt,num); i++; } inorder(bt); } void insert(struct btreenode **sr, int num) { if(*sr==NULL) { *sr=(struct btreenode *)malloc (sizeof(struct btreenode)); (*sr)->leftchild=(struct btreenode *)NULL; (*sr)->rightchild=(struct btreenode *)NULL; (*sr)->data=num; return; } else { if(num < (*sr)->data) insert(&(*sr)->leftchild,num); else insert(&(*sr)->rightchild,num); } return; } void inorder(struct btreenode *sr) { if(sr!=(struct btreenode *)NULL) { inorder(sr->leftchild); printf("\n %d",sr->data); inorder(sr->rightchild); } else return; } please Modify the given program and add two methods for post order and pre order traversals.

0 Answers  


write a program using c++ to implement single contiguous memory mangement techniques.display the content of the main memory after yhe allocation of jobs and percentage of the wastage of the main memory

0 Answers  






What is friend function?

12 Answers   Wipro,


why function overloading is not called as pure polymorphism?

2 Answers  


OOP'S advantages of inheritance include:

1 Answers   Infosys,


What are the important components of cohesion?

0 Answers  


what uses of c++ language?

3 Answers  


assume the program must insert 4 elements from the key board and then do the following programs.sequential search(search one of the elements),using insertion sort(sort the element) and using selection sort(sort the element).

0 Answers  


what is the size of an empty class

12 Answers   Wipro,


Categories