mirror of
https://github.com/Smaug123/WoofWare.PawPrint
synced 2025-10-19 04:08:39 +00:00
31 lines
538 B
C#
31 lines
538 B
C#
public class Program
|
|
{
|
|
public struct Point
|
|
{
|
|
public int X;
|
|
public int Y;
|
|
|
|
public Point(int x, int y)
|
|
{
|
|
X = x;
|
|
Y = y;
|
|
}
|
|
}
|
|
|
|
public static int Main(string[] args)
|
|
{
|
|
Point p = new Point(10, 32);
|
|
|
|
// Box the value type
|
|
object boxed = p;
|
|
|
|
// Cast boxed value type to object (should succeed)
|
|
object obj = (object)boxed;
|
|
|
|
// Unbox
|
|
Point unboxed = (Point)obj;
|
|
|
|
return unboxed.X + unboxed.Y;
|
|
}
|
|
}
|