#include h files

hi, guys i have a problem. I am doing my homework and came a cross a problem.
I have two include files which call each other, and the program doesn't work. is there any way to fix this? i thought that #ifndef will help me but it doesn't.

thanks!
It's probably a circular dependency between the classes in the headers.

Try including one of the headers in the the source file of the other, rather than the header.
Circular dependency is the problem.
Forward declarations are the solution.

http://en.wikipedia.org/wiki/Circular_dependency#Example_of_circular_dependencies_in_C.2B.2B
Topic archived. No new replies allowed.