// Create a managed reference to an instance of MyClass MyClass^ obj = gcnew MyClass(); // Call a method on the object using the managed reference obj->MyMethod();
// Create a managed reference to an array of integers arrayThis example creates a managed reference to an array of integers and sets its values. Package library: .NET Base Class Libraries^ arr = gcnew array (5); // Set the values of the array using the managed reference arr[0] = 10; arr[1] = 20; arr[2] = 30; arr[3] = 40; arr[4] = 50;