C/C++ Programmer's Guide (G06.27+, H06.08+, J06.03+)

Usage Guidelines
The _optional() operator can be used only as an actual argument to a variable or extensible
function.
The first expression must be scalar.
Examples
1. This example shows a caller of an extensible function that dynamically decides to pass one
of its arguments.
_extensible foo (int, int, int);
void bar (int i) {
/* Pass a third argument of 30 to foo only if i is not zero. */
foo (10, 20, _optional (i, 30));
}
2. This example shows a function that passes along one of its optional parameters only if an
actual parameter is supplied.
_extensible foo (int, int, int);
_extensible void bar ( int i, int j) {
/* Pass a third argument of j to foo only if j is present. */
foo (10, 20, _optional (_arg_present (j), j ));
}
3. This example shows an incorrect usage of the _optional operator.
_extensible foo (int, int, int);
_extensible void bar (int i, int j) {
foo (10,
20,
/* Error! The _optional operator is not used as an
actual parameter. It is used in an expression
that is the actual parameter. */
(_optional (_arg_present (j), j) + 1));
}
Data Types
The native C and C++ compilers, the TNS C compiler, and the TNS C++ preprocessor support
the predefined data types described in the ISO/ANSI C standard. In addition, HP has added three
additional data types: decimal,long long and unsigned long long. Table 8 summarizes
the predefined data types.
Table 8 Predefined Data Types
Abbreviated formsLong forms
boolbool
1
charchar
shortshort, signed short, short int, or signed short int
intint, signed, signed int
longlong, signed long, long int, or signed long int
unsigned shortunsigned short or unsigned short int
unsignedunsigned or unsigned int
unsigned longunsigned long or unsigned long int
unsigned long longunsigned long long int
Data Types 63