CISC 3110 Lecture #3

CISC 3110
Advanced Programming Techniques
Lecture #3
Separate Compilation


Motivation

A 'Model' to Think About What We're Going to Talk About

Calling a Function — What Information is Required?

Who is Responsible for Making Sure this information is Valid?

An Example

Our load function:

Separate Compilation

Modules

The combination of a .h and .cpp file is often known as a module. The two files play different, but complimentary roles:

C#include / Macro Guards

Given header file mymodule.h:
#ifndef MY_MODULE_H
#define MY_MODULE_H

…
…
…

#endif

Module Guidelines

Code Used in This Lecture