View Single Post
  #1 (permalink)  
Old November 17th, 2004, 07:27 PM
gillianbc gillianbc is offline
Authorized User
 
Join Date: Nov 2003
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default Incomplete Class Declaration

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
__________________
Gill BC
Reply With Quote