Skip to content

Instantly share code, notes, and snippets.

@abbas-oveissi
Created February 19, 2013 17:53
Show Gist options
  • Save abbas-oveissi/4988183 to your computer and use it in GitHub Desktop.
Save abbas-oveissi/4988183 to your computer and use it in GitHub Desktop.
sample C# code for Value vs Reference Types
struct Point
{
private int x, y; // private fields
public Point (int x, int y) // constructor
{
this.x = x;
this.y = y;
}
public int X // property
{
get {return x;}
set {x = value;}
}
public int Y
{
get {return y;}
set {y = value;}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment