Exercises in this lecture   previous -- Keyboard shortcut: 'p'  next -- Keyboard shortcut: 'n'  Go to the notes, in which this exercise belongs -- Keyboard shortcut: 'u'   Alphabetic index   Course home      

Exercise 1.4
Specialization of persons with a union type


Introduce two variants of persons, as introduced in the C program on the accompanying slide.

Introduce two different person types, and a union that allows us to represent either a 'person with a home address' or a 'homeless person'.

You can read about unions in The C++ Programming Language section C.8.2.


There is no solution to this exercise