Why Use a Module?

Modules let you compile pieces of your program separately. This is important for two reasons:

  1. When the program gets big, you only have to recompile the pieces you change; this saves time.

  2. You can share your modules with other programmers and they can leverage the code you've created in the same way that you use the iostream library.

What Is in a Header File?

Header files tell the compiler what is in the implementation module, such as the names and arguments of functions, and definitions of constants and data types.

The functions named in the header file are public, because any user of the module can see them. The implementation file, however, can contain functions not mentioned in the header file that cannot be used by anything ...

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.