-
Book Overview & Buying
-
Table Of Contents
Deciphering Object-Oriented Programming with C++ [WARNING: NOT FOR USE IN OTHER MATERIAL/SEE CONTRACT]
By :
In this section, we will examine the mechanics of function prototyping, such as necessary placement in files and across multiple files for greater program flexibility. We will also add optional names to prototype arguments, as well as understand how and why we may choose to add default values to C++ prototypes. Function prototypes ensure C++ code is strongly type-checked.
Prior to proceeding to function prototypes, let’s take a moment to review some necessary programming terms. A function definition refers to the body of code comprising a function, whereas a declaration of a function (also known as a forward declaration) merely introduces a function name with its return type and argument types. Forward declarations allow the compiler to perform strong type checking between the function call and its definition by instead comparing the call with the forward declaration. Forward declarations are useful because function definitions do not always...