Should I use a single header file for all declarations like "Windows.h"? or use a header file per class? What do you prefer? If I include more than what I need, will the linker automatically removes any unused code?
Should I use a single header file for all declarations like "Windows.h"? or use a header file per class? What do you prefer? If I include more than what I need, will the linker automatically removes any unused code?
If every thing depends on each other, or all these things are supposed to in under one big module then use one global include.Originally Posted by grayfox
If your code is chunks of reused modules, where some modules are used acrross projects, then have one file include file per module.
It all depends on how modular and reusable you want to make your software, in fact it is one of the design considerations, how to organize the source code, there are no strict rules for it. At the end of the day it should compile and work.
Only the used code is linked.Originally Posted by grayfox
grayfox (23rd July 2011)
Bookmarks