In the book I am learning from, it offers recommendations for getting classes to compile. It says
Quote:
quote:
1. Always put an incomplete class declaration in your .h files for each class that's referenced within the class definition in the .h file.
2. Always put your #include directives in the .cpp files in a sequence which ensures that each class definition that's included is preceded by the .h files for any dependent classes; these will be the classes for which you added incomplete class declarations.
|
I'm having trouble getting my head round this and very confused about where all the #includes go.
- What do the incomplete class declarations do during the compilation?
- Should I put them in the .cpp as well as the .h ?
Gill BC