An interface file in C++

We now consider the language C++.

This slide shows a typical interface file in C++. The lines that begin with hash marks are preprocessor directives. In this case, they are being used to ensure that a class definition will be seen no more than once by the compiler. The ifndef statement is true only if the argument, the word CARDH, is not defined. The next statement defines the name, so that on subsequent readings the material between the if and the matching endif will be ignored.

The interface file defines two new enumerated data types, one for the suits and one for colors.

The next slide will discuss the structure of the class definition itself.

[audio] [real] Text to accompany slide20, in Chapter 3 of An Introduction to Object-Oriented Programming