#include recursion trouble
OK, so I'm working on a RPG, and I have a player class and a monster class. I need each of these to use each other, but when I try to #include each one from the other, I get wicked #include recursion and my compiler rolls over and dies. Does anybody know how I can get around this without restructuring my game?
Re: #include recursion trouble
Quote:
Originally posted by ichijoji
OK, so I'm working on a RPG, and I have a player class and a monster class. I need each of these to use each other, but
Redesign your program. You shouldn't need to classes that depend on eachother. Either that, or make them friends.
A better method would be to make a 'creature' base class, and derive two types from it.
But yes, to fix your include issue, do as Bubba describes.