Jump to content
Site Stability Read more... ×
  • Advertisement


This topic is now archived and is closed to further replies.


Class pointers

This topic is 6138 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Original post by Zoot
NuffSaid, i want to create instantiate of the class later using the classlist.

Yes, LordShade class *classlist[128]; is legal.

I should have read the first post more closely. You will have to do runtime typing.

Also, I believe "class" is a keyword that ultimately compiles out to mean structure. Thus,

class* classlist[128]

is compiled out to

structure* classlist[128]

which means you don''t have a type defined so the compiler has no idea what type you are asking to store. Sure it can allocate the storage, a pointer is a pointer no matter what, but trying to assign something to it, well now, that''s when the compiler sits up and goes, "HUH!?"

Share this post

Link to post
Share on other sites
Zoot - C++ supports (currently ? Oh, please! Please! *beg* *grovel* Gimme! Please! )neither reflexion nor metaclasses. You can, however implement an abstract factory. See also this link in the C++ FAQ-Lite.

[ Start Here ! | How To Ask Smart Questions | Recommended C++ Books | C++ FAQ Lite | Function Ptrs | CppTips Archive ]
[ Header Files | File Format Docs | LNK2001 | C++ STL Doc | STLPort | Free C++ IDE | Boost C++ Lib | MSVC6 Lib Fixes ]

[edited by - Fruny on December 31, 2002 3:50:27 AM]

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!