Home »

What is Operator overloading ?

Question ListCategory: cWhat is Operator overloading ?
jeanderson295 author asked 8 years ago
1 Answers
shah_kajal184 author answered 8 years ago

When an operator is overloaded, it takes on an additional meaning relative to a certain class.
But it can still retain all of its old meanings.

Examples:

1) The operators >> and << may be used for I/O operations because in the header, they are

overloaded.

2) In a stack class it is possible to overload the + operator so that it appends the contents of

one stack to the contents of another. But the + operator still retains its original meaning

relative to other types of data.

Please login or Register to Submit Answer