Chapter 5. Functions

Images

Objectives

In this chapter, you’ll:

Construct programs modularly from functions.

Use common math library functions and learn about math functions and constants added in C++20, C++17 and C++11.

Declare functions with function prototypes.

View many key C++ Standard Library headers.

Use random numbers to implement game-playing apps.

Declare constants in scoped enums and use constants without their type names via C++20’s using enum declarations.

Make long numbers more readable with digit separators.

Understand the scope of identifiers.

Use inline functions, references and default arguments.

Define overloaded ...

Get C++20 for Programmers, 3rd 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.