-
Help Please
I have a class (lets say Stable) that takes an object of another class (Horse) as a parameter.
So I would have something like this in my header and implementation files....
void GetSomeInfo (Horse &t){}
Easy enough, but when I try to compile ,it doesn't recognize Horse.
So, I figured, well, I need to throw a #INCLUDE "horse.h", in the Stable header file, so the stable class would recognize what a horse was. Well, that doesn't work... (it dont recognize it)...
So how can I get one user defined class(Stable) to recognize another user defined class(Horse), so I can implement functions that a Horse object as a parameter.
Im using VC++ btw....
-
You must include "horse.h" ABOVE the declaration of "Stable", or it wont work.
Z.
-
yeah I've been doin that... it didn't help....
:\windows\desktop\student.h(14) : error C2629: unexpected 'class Student ('
c:\windows\desktop\student.h(14) : error C2238: unexpected token(s) preceding ';'
class
thats what happens when i try to compile it... thanks anyway.
-
probably syntax errors or something like that.
-
Quote:
Code:
:\windows\desktop\student.h(14) : error C2629: unexpected 'class Student ('
Try using braces rather than parentheses...