Majid Kamali

Majid Kamali

  • NA
  • 290
  • 256.8k

Problem with overloading operator+

Aug 8 2010 8:29 AM
Hello.
I wrote the code below:
 public static Point operator +(Point p1, Point p2)
{
return new Point(p1.X + p2.X, p1.Y + p2.Y);
}
But Creates error below on "operator+" :
One of the parameters of a binary operator must be the containing type

What's the problem?

Thanks.

Answers (9)