Objectives:
At the end of this lesson you will be able to:
 |
Describe Structures |
Structures form a very large building block with which to collect one or more variables, possibly of different types, grouped together into one collective unit using a single name for easy handling. They are a versatile data structure in which to clump data together in convenient little packages. Variables can be of any type: int, float, char or other struct etc.
Structure is commonly used to define records to be stored in files.
Structure, combined with pointers, can create linked lists, stacks, queues, and trees.
The main difference between structure and array is that arrays are collections of the same data type and structure is a collection of variables under a single name.