Chapter 7. FUNCTIONS—C++'S PROGRAMMING MODULES

In this chapter you learn

  • Function basics (review)

  • 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

  • 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. In this and the next chapter you'll examine how to define functions, convey information to them, and retrieve information from ...

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