Skip to main content
gamedev.net
🔒 Locked

problem with pointers

Started by Mastermin Dec 9, 2000 at 9:47 PM 0 replies 450+ views
Original Post
Mastermin
Mastermin
Hey, i know this prolly isn''t the place to post this kind of question but oh well i like this board better than any other so too bad k, i have two files, for simplicity, i''ll call them file1.cpp and file2.cpp In file1.cpp, i define a class called... A in file2.cpp, i define class B. there is a member of class A that is a pointer to B, or B* similarly, in class B there is a member that is a A*. this does not compile, in borland c++ 5.02, because it says B* is not a valid type. any ideas on how to fix this?? thanks
Quantum
Quantum
Try this: at the top of file1 put a decleration for class B like so:
class B;
And do the same to file2, put a decleration of class A:
class A;
Hopefully the compiler will now know about the different classes.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.