EXPLORATION 21

image

Function Arguments

This Exploration continues the examination of functions introduced in Exploration 20, by focusing on argument-passing. Take a closer look. Remember that arguments are the expressions that you pass to a function in a function call. Parameters are the variables that you declare in the function declaration. This Exploration introduces the topic of function arguments, an area of C++ 11 that is surprisingly complex and subtle.

Argument Passing

Read through Listing 21-1 then answer the questions that follow it.

Listing 21-1.  Function Arguments and Parameters

#include <algorithm>#include <iostream>#include <iterator> ...

Get Exploring C++ 11, Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.