Lecture 15 Objectives
At the end of today's class you should
KNOW:
- that a struct can be used to group together variables of different types
- that typedef can be used to give an alias name to a data type
BE ABLE TO:
- define a struct
- access individual members of a struct
- pass a struct to a function, using either call-by-value or call-by-reference
- de-reference a pointer to a struct
- define and use an array of struct
- use typedef to define a struct type
Sample Exam Question:
Using the struct book example from today's handout, define an
array called library that can contain information for as many as
1000 books. Assume the array has been filled in with information.
Write a statement that will determine the number of
characters in the author's name for the book at location 5 in the array.