Visual C++ .NET/Collections/Array Pointer

Материал из .Net Framework эксперт
Перейти к: навигация, поиск

Declare a Pointer to an Array

<source lang="csharp">

  1. include "stdafx.h"
  2. include <typeinfo.h>
  3. using <mscorlib.dll>

using namespace System; struct Rectangle {

   int x,y,w,h;

}; int main(void) {

   Rectangle rects[5];
   rects[0].x = 10;
   rects[0].y = 20;
   rects[0].w = 50;
   rects[0].h = 100;
   Console::WriteLine(rects->x);
   return 0;

}

 </source>