O'Reilly logo

Just Enough C/C++ Programming by Guy W. Lecky-Thompson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Function Parameter Lists

As noted in the function declaration and prototyping sections, a function can have zero or more parameters contained in a list in parentheses. As you’ve seen, these are declared in the usual fashion of a data type, followed by a variable name. If a calling process wants to use the function, it must do so using the same form.

The act of calling the function with parameters is known as passing values (or variables) to the function. The calling code can pass constant values that match the type of the parameters or a variable. The variable must match the type of the parameter, either by casting into the target type or using a variable of the correct type from the outset.

The types are fairly strict and will be caught at compile ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required