INTRODUCTION TO STRUCTURES
,STRUCTURES
,INTRODUCTION TO STRUCTURES
A Structure is a collection of related data
items, possibly of different types.
A structure type in C++ is called struct.
A struct is heterogeneous in that it can be
composed of data of different types.
In contrast, array is homogeneous since it
can contain only data of the same type.
, DEFINITION OF STRUCTURES
Structures hold data that belong together.
Examples:
Student record: student id, name,
major, gender, start year, …
Bank account: account number,
name, currency, balance, …
Address book: name, address,
telephone number, …
In database applications, structures are
called records.