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.

Implementation

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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.