The custom types allow you to specify new data formats. To make use of this format you must declare variables that use the types you have created. You can use your new types when you declare local variables and parameters, allowing you to store values in this format and pass the around between your functions and procedures.
Some examples of how you can use your types to declare the kind of data stored in variables
Variables - Why, When, and How
Variables haven’t changed, but now you have more control over what they can store. Once you have created your own type, you can use this type when you create a variable - where ever that variable is coded.
In C/C++
In C/C++ it is possible to initialise a struct when you declare the variable. To do this, you use braces to wrap the values for the fields as (i.e. {...} ). Within the braces you place one value for each field, in the order you declared them in the struct. These values are then used to initialise the fields of the variable. See the declaration of var2 in the example below.
Unions can also have their values initialised. This also uses the brace notation, but this time you name the field you want to initialise. This sets the value of the union to store the indicated type. See the declaration of var5 in the code below.
Example
The following example demonstrates declaring and using values from the different kinds of types you can create.