Array of classes and a pointer to it

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
Your code does not compile for Visual C++......
Eitan

Robbe Morris said:
MyClass[] myvar = new MyClass[4,8];

--
2004 and 2005 Microsoft MVP C#
Robbe Morris
http://www.robbemorris.com
http://www.masterado.net/home/listings.aspx



Eitan said:
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
 
Eitan said:
Your code does not compile for Visual C++......

You didn't say you wanted it in C++ :)

I suggest that as you're asking a language-specific question, you ask
it in a language-specific newsgroup. In this case,
microsoft.public.dotnet.languages.vc would probably be the best bet.
 
No problem.
Thanks Eitan

Jon Skeet said:
You didn't say you wanted it in C++ :)

I suggest that as you're asking a language-specific question, you ask
it in a language-specific newsgroup. In this case,
microsoft.public.dotnet.languages.vc would probably be the best bet.
 
Back
Top