Chapter 10 : Miscellaneous

Chapter 10 : Miscellaneous

Contents

10.1. Unions

Unions allow two ALTERNATIVE data items to share storage.

x can now be either an integer, or a float. Use

Beware of assigning to `x.i' and then using the value of `x.f'. There are no machine checks.

You may typically have a marker to tell you the type of object currently stored.

The `type' field keeps an indicator of the type of structure stored.

10.2. Enumerated types

This will be familiar to Pascal freaks.

Copyright Eric Foxley 1996


Notes converted from troff to HTML by an Eric Foxley shell script, email errors to me!