Using pointer arithmetic on the interior pointer : Pointer « Data Type « Visual C++ .NET

Home
Visual C++ .NET
1.2D
2.Class
3.Collections
4.Data Type
5.Database ADO.net
6.Delegate
7.Development
8.File Directory
9.Function
10.Generics
11.GUI Form
12.Language Basics
13.Network
14.Reflection
15.Security
16.Statement
17.Structure
18.Thread
19.XML
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Visual C++ .NET » Data Type » Pointer 
Using pointer arithmetic on the interior pointer
 

#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
   }
}

   
  
Related examples in the same category
1.Address Indirect
2.Int pointer
3.Pointer To String Chars
4.Int Pointer with gcnew
5.Int Pointer Arithematic
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.