Chapter 3. C++ Program Structure

This chapter examines C++ program structure from the perspective of functions and data. We begin with function definitions, inline functions, recursion, pointers to functions, and functions with default arguments. To organize data for functions to access, we present structures and unions, member functions, and how to pass structures and unions as functions arguments efficiently with references. We also look at C++ storage classes, exceptions, and namespaces. Lastly, we discuss the run-time allocation and release of free store memory, using the C++ operators new and delete.

Get Navigating C++ and Object-Oriented Design 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.