#include "stdafx.h"
using namespace System;
value class MyClass{
int i, j;
public:
void PrintStartingAddress()
{
interior_ptr ptr_to_this = this;
pin_ptr pinned_this = ptr_to_this;
Console::WriteLine("Starting address of object is 0x{0:x}",reinterpret_cast(pinned_this));
}
};
int main()
{
MyClass v;
v.PrintStartingAddress();
}