#Mastery12

Creating C++ functions

In C++, a function is a group of statements that is given a name, and which can be called from some point of the program. You need a type of the value returned by the function,  a identifier by which the function can be called, and parameters. Each parameter consists of a type followed by an identifier, with each parameter being separated from the next by a comma. Each parameter looks very much like a regular variable declaration and in fact acts within the function as a regular variable which is local to the function. The purpose of parameters is to allow passing arguments to the function from the location where it is called from.

This is one example I did for WSQ08

CC BY 4.0 #Mastery12 by Aurora Alvarado is licensed under a Creative Commons Attribution 4.0 International License.

Comments are closed.