June 2017
Intermediate to advanced
304 pages
7h 12m
English
Like structures, discriminated unions help as a valid type name in further declarations. They are followed by the type name and then the switch keyword, and they can take parameters of the type int/char/Boolean or enum:
. employee_dept {admin, sales, it, business};union employee switch (employee_dept) { case admin, business : age_spec age; cae sales : sales_detail sales; default float salary;};
Read now
Unlock full access