all groups > dotnet academic > may 2005 >
You're in the

dotnet academic

group:

Array of classes and a pointer to it



Array of classes and a pointer to it Eitan
5/3/2005 5:20:03 PM
dotnet academic: Hello,

I defined a class name MyClass.

I would like to define an array of 4 by 8 of that class.
I would like to define a pointer to the array of MyClass.

I tried it with static definition:
MyClass m_MyClass[4][8] ;
I can not seem to find the way to define a pointer to this array?!?!?

I tried also to define it with the new operator but had similar results.

Any ideas how to do it?

Eitan
Re: Array of classes and a pointer to it Peter van der Goes
5/5/2005 9:36:44 AM

[quoted text, click to view]
The issue is how the compiler actually sees a two dimensional array. There
numerous articles available in the Google Groups archives on this topic
(search on "pointer to two dimensional array"). Here's a web page that
discusses it:

http://web.torek.net/torek/c/pa.html


--
Peter [MVP Visual Developer]
Jack of all trades, master of none.

RE: Array of classes and a pointer to it Ravichandran J.V.
5/17/2005 12:20:06 AM
An array of 4 by 8 would be declared as

MyClass[4,8] o;

BTW, what is the language that you are referring to? By your naming
convention and the need for pointers makes me think that you are probably
talking about c++.

Pls clarify.

with regards,

J.V.


[quoted text, click to view]
AddThis Social Bookmark Button