ProAnswers.org

what is operator overloading

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.