What Is a Module?

Modules are files that can be compiled separately. The result of compiling these modules is a set of compiler output files. These files can be brought together by a linker to generate a single program you can run.

You've already made use of a module—iostream—in previous lessons.

Two files—a header file (ending in .h) and an implementation file (ending in .cpp)—make up a C++ module. main.cpp is the only exception to this rule. It is an implementation file that never has an accompanying header file.


The part of a program that contains the code that can be run. A header declares the allowable ways to call on that code. ...

Get SAMS Teach Yourself C++ in 10 Minutes SECOND EDITION now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.