This chapter shows you how to create different kinds of data structures. After creating an array of structures, you can store many occurrences of your data values. Arrays of structures are good for storing a complete employee file, inventory file, or any other set of data that fits within the structure format. Whereas arrays provide a handy way to store several values that are the same type, with arrays of structures you can store several values of different types together, grouped as structures. Dynamic memory allocation enables you to reserve memory when you need storage instead of having to define variables in advance.
This chapter teaches you the following topics:
Creating arrays of structures
Initializing arrays of structures
Referencing elements from a structure array
Dynamic memory allocation with malloc() and free()