O'Reilly logo

Just Enough C/C++ Programming by Guy W. Lecky-Thompson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Prototyping Revisited

Recall the term prototyping in Chapter 2 when you looked at separating C code into header files and source files. You also looked briefly at how you could provide the prototypes in the source file, before they are formally implemented, to allow forward references in the code.

A forward reference is simply the possibility to use a function before the implementation has been compiled. To do this, the compiler needs to have a prototype to work. This way, the compiler has the correct profile for the function calls to verify that they are being used correctly.

The implementation of classes as source code follows a similar pattern. The compiler will build the object code from the source independently of the main program. However, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required