Structures, Unions, Enumerations and Typedefs
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.
KeywordsFunction Argument Member Function Float Mass Void Main Const Point
Unable to display preview. Download preview PDF.