|
-
March 5th, 2011, 10:34 AM
#1
[RESOLVED] how should I arrange classes in files?
Do you know some "good practices"?
I've came across certain situations where I had to add things to classes that required certain headers and the project could not have been compiled anymore because of things like: file1.h requires files2.h which requires file1.h.
The last problem with things like this was this:
File1.h contained the definition of Class1
File2.h contained the definition of Class2
File1.h declared Class2 as friend (which meant I had to #include File2.h in it)
File2.h required data and data types from File1.h (which meant I had to #include File1.h in it)
And it didn't compile.
And I lose time trying to figure out how to make it work. Can anyone give some suggestions of "good practices" to avoid situations like this or to be able to solve them quicklier?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|