Summary

In this chapter we looked at C++ functions as a major program-building tool. C++, as a descendant of C, is unique among modern programming languages, by requiring the programmer to provide prototypes of the functions used in each source code file. This rule supports separate compilation and hence the management of large projects but creates additional problems for the designer and for the maintainer.

Parameter passing is a complex skill in C++. The programmer has to coordinate the code that is written for the function in four places: in the client code (in the function call itself), in the server function header, in its prototype, and in the body of the server function. Often this is much too much, and something goes wrong in one of ...

Get Core C++ A Software Engineering Approach 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.