classes in classes
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?
You can also use:
/*=========================================*/
/* Chem0sh */
/* Lead Software Engineer & Tech Support */
/* http://www.eFaces.biz */
/*=========================================*/
class TypeB *ObjectB;
/*=========================================*/
/* Chem0sh */
/* Lead Software Engineer & Tech Support */
/* http://www.eFaces.biz */
/*=========================================*/
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 */
/*=========================================*/
/*=========================================*/
/* Chem0sh */
/* Lead Software Engineer & Tech Support */
/* http://www.eFaces.biz */
/*=========================================*/
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement