next up previous contents index
Next: The @ operator Up: Expressions Previous: Set constructors

Value typecasts

Sometimes it is necessary to change the type of an expression, or a part of the expression, to be able to be assignment compatible. This is done through a value typecast. The syntax diagram for a value typecast is as follows:


Typecasts

syntdiag2830

Value typecasts cannot be used on the left side of assignments, as variable typecasts.

Here are some valid typecasts:
listing2815

The type size of the expression and the size of the type cast must be the same. That is, the following doesn't work:
listing2817


next up previous contents index
Next: The @ operator Up: Expressions Previous: Set constructors

Michael Van Canneyt
Fri Sep 25 09:15:40 MEST 1998