Advertisement

Class trouble

Started by June 04, 2000 12:29 PM
2 comments, last by Sludge 24 years, 6 months ago
I have defined 2 classes and both need a pointer to another class like this:

class CLASS1{
   public:
   void function(CLASS2 *);
};

class CLASS2{
   public:
   void function(CLASS1 *);
};
There seems to be no way to solve this. Is it possible to predefine something like that? Any solutions? Sludge Software www.sludgesoft.com Developing a secret of mana style role-playing-game
Sludge Softwarewww.sludgesoft.comDeveloping a secret of mana style role-playing-game
You need to predefine CLASS2 before using it within CLASS1, like so:

class CLASS2;

class CLASS1{
public:

blah blah
};
Advertisement
Hi

Maybe I misunderstood your question but why not two header files one for class1 and one for class2 and then include the one in the other ? Maybe you are talking about an compledly different problem than just ignore this post.
May the force be with you
Thanks

Just the information I needed.
Sludge Softwarewww.sludgesoft.comDeveloping a secret of mana style role-playing-game

This topic is closed to new replies.

Advertisement