two classes contain objects of each other

Posted by Julz on Stack Overflow See other posts from Stack Overflow or by Julz
Published on 2010-05-08T09:49:32Z Indexed on 2010/05/08 9:58 UTC
Read the original article Hit count: 200

Filed under:
|

hi, i hope there's a simple answer to this. without getting too complicated i have two classes. an "Animal" and a "Cell" Cell contains an Animal as a member. Animal has methods that accept Cells in their parameters.

i'm just confused as to how i #include each class the others header? i've only ever had to go up a chain of classes and just included the last class header in the next and so on, but this circular situation has me a bit lost.

i hope that makes sense, any help greatly appreciated.

© Stack Overflow or respective owner

Related posts about c++

Related posts about homework