   C++ class help
  Ah im frustrated..  please read the code and comments below//class 1class wizard{public:    void draw();   void waveWand();    //here's where i have problems    void shootFireBall(projectile * fireBall);};//class 2class projectile{public:    void draw();   void move();    /*I can't move this class above the wizard class because it uses the wizard class */    void collide(wizard * merlin);};So i want to want make an object using the projectile class in the wizard class, but to the compiler the projectile class hasn't been declaredI apreciate any help   nuclearfission   
  You need to forward declare your projectile class. Put the following before your wizard class:class projectile;Everything should be happy after that.   ;  As the above poster said, you can prototype classes just like functions, just forward declare it.   ;  Or include the header file for the file where projectile is defined.   ;  That won't work because you'll get a recursive definition.And even if you prevent that (through include guards or #pragma once), it won't solve the OP's problem.So, yes, a forward declaration is necessary.   ;  You could put the class projectile in class wizard after public:. idk   ;  thank you guys so much [smile]   but i wont get to try your solutions for three days due to that im going on vacation in about two minutes... [sad]   ;  Break the mutual dependency. If you introduce something like a bounding box (or bounding circle) object, then the wizard will have function to get its bounding shape, and the projectile can test for collision with the bounding shape.   ;Quote:Break the mutual dependency. If you introduce something like a bounding box (or bounding circle) object, then the wizard will have function to get its bounding shape, and the projectile can test for collision with the bounding shape.What he said... Basically, a forward declaration of the wizard class will fix the compile errors, but it won't fix the underlying design flaws. Assuming you have a reasonable understanding of inheritance, I would suggest that you create a simple abstraction, and separate the collision functionality into a new class (from which wizard can then be derived).Here's what I mean:class CollisionObject{public:BBox GetBBox();};class Projectile{public:void Collide(CollisionObject *pCollisionObject);};class Wizard : public CollisionObject{};The major advantage of this method is that when you come to introduce new classes, you won't need to create new collide methods within your projectile class in order to support them, you can simply inherit from CollisionObject instead.Hope that helps.   ;  im still getting compile errors...  Is this right?//declarationclass projectile;class wizard{...};class projectile{...};here's some VC++8 erros that im gettingerror C2027: use of undefined type 'projectile' see declaration of 'projectile'   