Jump to content
  • Advertisement

Archived

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

Damocles

classes in classes

This topic is 5822 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

Another little class question.... ...I want to try and use classes as much as possible for the game I''m working on, so basically anything that can be a class will be. However, I''m finding one problem: say I have: class TypeA { int whatever; float something; TypeB *ObjectB; } TypeB is a clas define in another header file. I know I can just include that header file and all is well, but if I use that method, by the time I get half-way through making the classes, I''ll have pages of include statements in each header file, and that''s just not good. So what''s the best way of making class objects inside other classes?

Share this post


Link to post
Share on other sites
Advertisement
You can also use:

class TypeB *ObjectB;


/*=========================================*/
/* Chem0sh */
/* Lead Software Engineer & Tech Support */
/* http://www.eFaces.biz */
/*=========================================*/

Share this post


Link to post
Share on other sites
I had a feeling it was some kind of forward declaration, but I wasn''t sure.

/*=========================================*/
/* Chem0sh */
/* Lead Software Engineer & Tech Support */
/* http://www.eFaces.biz */
/*=========================================*/

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!