composition

i was trying to write a program about solving sudokus, and i got that problem. i have class called Board.h , and this class has a data member of class Cell.h which is defined by me. everything works until here. then i wanted to add a pointer to board for cell objects, ie i tried to include Board.h in Cell.h without changin anything just putting the line "#include Board.h" to Cell class header file. and many errors suddenly came out. is it not allowed in C++ to include a class that includes this class (sorry for my bad english)? i shoukd also say i am a begginer
thanks
forward declare class Board in "Cell.h"

This is explained here :
http://www.cplusplus.com/forum/articles/10627/
(see part 4, The "right way" to include)
Last edited on
thank you. it was very helpful. and the article was very nice, too.
Topic archived. No new replies allowed.