Chapter 7. Functions: C++’s Programming Modules

In this chapter you’ll learn about the following:

• Function basics

• Function prototypes

• How to pass function arguments by value

• How to design functions to process arrays

• How to use const pointer parameters

• How to design functions to process text strings

• How to design functions to process structures

• How to design functions to objects of the string class

• Functions that call themselves (recursion)

• Pointers to functions

Fun is where you find it. Look closely, and you can find it in functions. C++ comes with a large library of useful functions (the standard ANSI C library plus several C++ classes), but real programming pleasure comes with writing your own functions. This chapter ...

Get C++ Primer Plus, Fifth Edition 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.