// Structs.cpp : main project file.

#include "stdafx.h"

using namespace System;

// The Point structure definition
// The version 1 of the Managed Entensions for C++
// uses __value
value struct Point
{
	public:
		int x, y;
		Point(int xVal, int yVal) { x = xVal; y = yVal; }
};

int main(array<System::String ^> ^args)
{
    // Create a Point
	Point p1;
	Point p2(10,20);   // use the second constructor to set x

	// Initialize its members
	p1.x = 10;
	p1.y = 20;

	// Write to the standard output
	Console::Write("p1.x is ");
	Console::WriteLine(p1.x);

	Console::Write("p2.x is ");
	Console::WriteLine(p2.x);

	Console::Write("p2.y is ");
	Console::WriteLine(p2.y);

	return 0;
}
