M
mshngo
Hi,
I have seen two main methods of organizing the header and source files
in a C++ project. The first method separates the public header files
from the remaining files (i.e., source files and internal/
implementation header files) -- the public header files are usually
stored in a directory named "include", and the remaining files are
stored in another directory named "src". The structures of these two
directories are usually closely related. For example, Postgres adopts
this organization.
The second method does not enforce such a separation -- files are
placed in directories according to which software module they belong
to, so that header files and source files belonging to the same module
will be placed within the same directory.
What are the trade-offs?
Thanks!
Mingsheng
I have seen two main methods of organizing the header and source files
in a C++ project. The first method separates the public header files
from the remaining files (i.e., source files and internal/
implementation header files) -- the public header files are usually
stored in a directory named "include", and the remaining files are
stored in another directory named "src". The structures of these two
directories are usually closely related. For example, Postgres adopts
this organization.
The second method does not enforce such a separation -- files are
placed in directories according to which software module they belong
to, so that header files and source files belonging to the same module
will be placed within the same directory.
What are the trade-offs?
Thanks!
Mingsheng