|
-
Dec 13th, 2001, 04:59 PM
#1
Thread Starter
I wonder how many charact
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....
-
Dec 13th, 2001, 06:26 PM
#2
You must include "horse.h" ABOVE the declaration of "Stable", or it wont work.
Z.
-
Dec 13th, 2001, 08:53 PM
#3
Thread Starter
I wonder how many charact
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.
-
Dec 14th, 2001, 07:58 AM
#4
probably syntax errors or something like that.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Dec 14th, 2001, 03:45 PM
#5
Monday Morning Lunatic
Code:
:\windows\desktop\student.h(14) : error C2629: unexpected 'class Student ('
Try using braces rather than parentheses...
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|