Passing a Structure to a Function

Learn how to pass a structure and its elements to a function.

Passing structure elements

We can pass elements of a structure either by value or by reference.

Passing structure elements by value

The basic syntax of passing elements of a structure by value is given below:

functionName (structVariable.memberName);