R
Rares Vernica
Hi,
Is it a good practice to include other .h files in a .h file?
For example, if I have a .h file that uses other two .h files I have two
options:
1. include the two used .h files in the .h file that uses them; in the
main .cpp file only include the top .h file
2. do not include .h files in any .h file; in the main .cpp file include
all the .h files
I wonder how bad is the first option.
I am currently using the second option and I end-up including 10 .h
files and just 1 of them is related to my .cpp file, the rest of 9 are
dependencies.
Is there any other option?
Thanks,
Ray
Is it a good practice to include other .h files in a .h file?
For example, if I have a .h file that uses other two .h files I have two
options:
1. include the two used .h files in the .h file that uses them; in the
main .cpp file only include the top .h file
2. do not include .h files in any .h file; in the main .cpp file include
all the .h files
I wonder how bad is the first option.
I am currently using the second option and I end-up including 10 .h
files and just 1 of them is related to my .cpp file, the rest of 9 are
dependencies.
Is there any other option?
Thanks,
Ray