Skip to content

Instantly share code, notes, and snippets.

@GSoster
Last active January 14, 2019 17:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save GSoster/ce16c8f28725800f6ca924844582ca81 to your computer and use it in GitHub Desktop.
Save GSoster/ce16c8f28725800f6ca924844582ca81 to your computer and use it in GitHub Desktop.
Blog Post - CSharp Operator Overloading
using System;
namespace OperatorOverloading
{
class Program
{
static void Main(string[] args)
{
Point a = new Point(10, 2);
Point b = new Point(2, 10);
Point c = a + b;
Console.WriteLine($"Point C.X = {c.X} C.Y = {c.Y}"); // prints: Point C.X = 12 C.Y = 12
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment