Structures, Unions, Enumerations and Typedefs

  • Graham M. Seed


This chapter examines structures, unions, enumerations and typedefs which allow a programmer to create new data types. The ability to create new types is an important and very powerful feature of C++ and releases a programmer from being restricted to the integral types offered by the language. Structures enable a programmer to form a collection of similar or different data types into a single user-defined data type, unlike arrays, which are collections of a single data type. The data members of a structure are, by default, publicly accessible. User-defined structures integrate exactly into the language. In other words, there is a single syntax for the definition and manipulation of objects of both integral C++ and user-defined types.


Encapsulation Dick 


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Copyright information

© Springer-Verlag London Limited 1996

Authors and Affiliations

  • Graham M. Seed
    • 1
  1. 1.Department of Mechanical & Chemical EngineeringHeriot Watt UniversityEdinburghUK

Personalised recommendations