471,331 Members | 1,478 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,331 software developers and data experts.

Array of classes and a pointer to it

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
Jul 21 '05 #1
5 1058
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" <Ei***@discussions.microsoft.com> wrote in message
news:D0**********************************@microsof t.com...
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

Jul 21 '05 #2
Your code does not compile for Visual C++......
Eitan

"Robbe Morris [C# MVP]" wrote:
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" <Ei***@discussions.microsoft.com> wrote in message
news:D0**********************************@microsof t.com...
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


Jul 21 '05 #3
Eitan <Ei***@discussions.microsoft.com> wrote:
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.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Jul 21 '05 #4
No problem.
Thanks Eitan

"Jon Skeet [C# MVP]" wrote:
Eitan <Ei***@discussions.microsoft.com> wrote:
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.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too

Jul 21 '05 #5
No problem.
Thanks Eitan

"Jon Skeet [C# MVP]" wrote:
Eitan <Ei***@discussions.microsoft.com> wrote:
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.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too

Jul 21 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by James | last post: by
3 posts views Thread by Mark Dunmill | last post: by
19 posts views Thread by Mark | last post: by
15 posts views Thread by Eric Lilja | last post: by
3 posts views Thread by Peter Oliphant | last post: by
26 posts views Thread by aruna.mysore | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.