4.5. SummaryΒΆ

  1. Like Python, C++ supports the use of functions.

  2. In C++, a function definition requires a name, a group of parameters, a return type, and a body.

  3. Non-fruitful functions in C++ must contain the keyword void in its function definition.

  4. You can pass variables by value as well as by reference in C++ functions. Passing by reference utilizes the use of pointers.

  5. Pass by reference is useful when you require a function to return multiple variables.

  6. To pass an array to a function you need to use an array parameter. The array parameter is denoted by the array variable name followed by set of square brackets ([ and ]).

You have attempted of activities on this page