Different parts of a system can be segregated into logical groupings yet rely on one another via file inclusion.
C and C++ are designed to leverage include while also optimizing build time by allowing declaration separate from implementation.
Both C and C++ are typically used with the C preprocessor that replaces a #include directive line with the content of the file specified.
A header file declares programming elements such as functions, classes, variables, and preprocessor macros.
The C++ standard library is similar, but the declarations may be provided by the compiler without reading an actual file.
A C++ standard library name in angle brackets (i.e.
This approach is not commonly used; instead, procedures are generally grouped into modules that can then be referenced with a use statement within other regions of code.
For modules, header-type interface information is automatically generated by the compiler and typically put into separate module files, although some compilers have placed this information directly into object files.
The language specification itself does not mandate the creation of any extra files, even though module procedure interfaces are almost universally propagated in this manner.
(It has been common practice to name Pascal's include files with the extension .inc, but this is not required.)
Some of these languages (such as Java and C#) do not use forward declarations and, instead, identifiers are recognized automatically from source files and read directly from dynamic library symbols (typically referenced with import or using directives).