class with managed array : Array « Collections « 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
Visual C++ .NET » Collections » Array 
class with managed array
 

#include "stdafx.h"
ref class MyClass
{
   private:
      array<double>^ pos;  // declare the managed array
      unsigned int a;
      unsigned int b;

   public:
       MyClass()
       {
           pos = gcnew array<double>(3);
           pos[00; pos[10; pos[20;
           a = 1;
           b = 1;
       }
       MyClass(double x, double y, double z, unsigned int atNo, unsigned int n): a(atNo), b(n)
       {
          pos = gcnew array<double>(3);
          pos[0= x; pos[1= y; pos[2= z;
       }
};

   
  
Related examples in the same category
1.Single dimension Arrays
2.Using gcnew to create array
3.Declare, create, and initialize a 1D native array
4.Declare, create, and initialize a 1D managed array
5.Declare, create, and initialize a 2D native array
6.Declare, create, and initialize a 2D managed array
7.Array initializing
8.Array for each
9.Shallow copy creates another name for the array
10.Using Array::Copy to copy array
11.Array equality test
12.Using array.Equals to test if two arrays are equal
13.Get array length
14.Sort array with Array.Sort
15.Using Array.BinarySearch to search an element in an array
16.Using for each to loop through an array
17.Arrays iterators
18.Create an object for each object array position
19.Loop over the array with the interior pointer
20.Create an interior pointer to elements of the array
21.Array initialization without gcnew
22.Using gcnew to create array
23.Object array with non default constrctuctor
24.Assign value from native array to managed array
25.String arrays length
26.Use variables in the initializer list
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.