I have two ADTs, let's call them A and B. A includes B's header file, and vice-versa. I'm getting a buttload of compile errors and was wondering how to remedy this?
use forward declaration in your header. google it if you don't know what it is. basically if you only have references and pointers to class B in class A's header, you can just declare an "incomplete" class B and avoid having to include B's header
Don't do it this way. You still run into the same question about what order the includes need to be in anyway.
Do what CTho9305 said and write a forward declaration. What this essentially does is tell the compiler that such a class will exist and make sense once the linking is done.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.