22 Introduction to Structures

Chapter 23
Arrays of Structures
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()

 



C by Example
C by Example
ISBN: 0789722399
EAN: 2147483647
Year: 1999
Pages: 43
Authors: Greg Perry

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net