Why do we need to overload operators?

Because you can write clearer and more concise code if you overload operators so that they can be used on objects. For example, you might want to overload + so that you can write

object1 + object2

instead of creatinig an Add method which would look like

object1.Add(object2)

The first form is clearer and makes more sense conceptually.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.