Chapter 8 Data Unit Type Table of Contents 8.1 User-defined Data Type/Data Unit Type .......................................... 8-2 8.2 Structure ......................................................................................... 8-2 8.2.1 Definition of a Structure ................................................................ 8-2 8.2.2 Creating a Structure ..................................................................... 8-2 8.2.3 Using a Structure Variable ............................................................. 8-5 8.2.4 Applications of Structures ..............................................................
8-6 8.2.5 Change Structure to Enumeration ................................................... 8-9 8.3 Enumeration .................................................................................. 8-10 8.3.1 Definition of Enumeration ............................................................ 8-10 8.3.2 Creating an Enumeration ............................................................. 8-10 8.3.3 Using an Enumeration Variable ..................................................... 8-12 8.3.4 Applications of Enumerations ....................................................... 8-14 8.3.5 Change Enumeration to Structure .................................................
8-15 8.4 Union ............................................................................................ 8-16 8.4.1 Definition of Union ...................................................................... 8-16 8.4.2 Creating an Union....................................................................... 8-16 8.4.3 Using an Union Variables ............................................................. 8-19 8.4.4 Application of Union .................................................................... 8-20 8.4.5 Built-in Members and Data Type ................................................... 8-23 8-1