Simple vs Structured Data Types
- Up until now, we have studied simple data types
- These hold a single value (1, 3.4 'a', or SuitT::HEART)
- They can't be broken down any further.
- Simple datat types include
- integer types
- floating point types
- enumerations
- We begin to look at structured data types
- Or data types that consist of several items.
- These can be homogeneous - all the same type like a string which is a collection of characters
- They can be heterogeneous - or made up of one or more type.
- Structured data types in C++ consist of
- structures - a heterogeneous collection of data
- arrays - a homogeneous collection of data
- classes - a homogeneous collection of data and methods
- unions - a single storage location that can be accessed multiple ways.
- We have encountered classes before this
- strings are classes.
- streams are classes.
- We also have begun to explore arrays
- Using the [] operator with a string gives us array experience.
- Finally there are two other types we will discuss later
- pointers and references are address based data types.