The following example shows you how to pass a pointer to a packed decimal variable to a function.
Figure 282. ILE C Source to Pass a Pointer to a Packed Decimal Value to a Function
|
The packed decimal argument in the function call has to be the same type as the packed decimal in the function prototype. If overflow occurs in a function call with packed decimal arguments, no error or warning is issued during compilation, and a run-time exception is generated.
The output is as follows:
+--------------------------------------------------------------------------------+ | The packed decimal number is: 123.45 | | Press ENTER to end terminal session. | +--------------------------------------------------------------------------------+
(C) Copyright IBM Corporation 1992, 2005. All Rights Reserved.