Archived

This topic is now archived and is closed to further replies.

classes including each other, anyway around?

This topic is 5511 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I currently have two classes in my Tetris clone. One is Field, representing the play space, and the other is block, representing a single square area. Problem is each has a reference to the other and the compiler doesn''t like it. Here is what it looks like: // Field.h class Field { vector > m_Field; }; // Block.h class Block { Field & m_rField; } Problem is that to define one requires the other, so I can''t seem to get the compiler to relize the two exist. Any ideas?

Share this post


Link to post
Share on other sites