6 Functions and an Introduction to Recursion

Objectives

In this chapter you’ll:

  • Construct programs modularly from functions.

  • Use common math library functions.

  • Use function prototypes to declare a function.

  • Use random-number generation to implement game-playing applications.

  • Use C++14 digit separators to make numeric literals more readable

  • Understand how the visibility of identifiers is limited to specific regions of programs.

  • Understand how the function call/return mechanism is supported by the function-call stack and activation records.

  • Understand the mechanisms for passing data to functions and returning results.

  • Use inline functions, references and default arguments.

  • Define with the same name overloaded functions that perform different tasks based on the number and types of their arguments.

  • Define function templates that can generate families of overloaded functions.

  • Write and use recursive functions.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset