#include "stdafx.h"
using namespace System;
ref class MyObject
{
};
int main()
{
array<MyObject^>^ array_of_buf = gcnew array<MyObject^>(10);
for each (MyObject^ bref in array_of_buf)
{
bref = gcnew MyObject();
}
interior_ptr<MyObject^> ptr_buf;
for (ptr_buf = &array_of_buf[0]; ptr_buf <= &array_of_buf[9]; ptr_buf++)
{
MyObject^ buf = *ptr_buf;
// use the MyObject class
}
}
|