July 2013
Intermediate to advanced
124 pages
1h 42m
English
CHAPTER 28
![]()
Headers
When a project grows it is common to split the code up into different source files. When this happens the interface and implementation are generally separated. The interface is placed in a header file, which commonly has the same name as the source file and a .h file extension. This header file contains forward declarations for the source file entities that need to be accessible to other files in the project.
Why to use headers
C++ requires everything to be declared before it can be used. It is not enough to simply compile the source files in the same project. For example, if a function is placed in MyFunc.c, and a second ...
Read now
Unlock full access