Sams Teach Yourself C in 21 Days

(singke) #1

DAY 11


WEEK 2


Implementing Structures,


Unions, and TypeDefs


Many programming tasks are simplified by the C data constructs called struc-
tures. A structure is a data storage type designed by you, the programmer, to
suit your programming needs exactly. Today you will learn:


  • What simple and complex structures are

  • How to define and declare structures

  • How to access data in structures

  • How to create structures that contain arrays and arrays of structures

  • How to declare pointers in structures and pointers to structures

  • How to pass structures as arguments to functions

  • How to define, declare, and use unions

  • How to use type definitions with structures


18 448201x-CH11 8/13/02 11:17 AM Page 249

Free download pdf