- Understand the dot-operator notation for accessing the contents of a
structure
structVariable.internalData
- Understand the arrow operator notation, for accessing the contents of
a structure when you have a pointer to the structure
structPointer->internalData
- Examples of both:
Student s;
Student* sptr = &s;
s.gpa = 3.75;
sptr->idNumber = 12345;
// understand that this last one is equivalent to: (*sptr).idNumber
- Know how to initialize a struct on the declaration line, with the
set-notation shortcut
Date d = {12, 25, 006};
- Be able to apply all these techniques (dot-operator, arrow operator,
and initializer set) to the case of nested structs as well -- i.e.
structure variable as a member of another structure)
- Understand how the assignment operator works with structures
- However, you cannot expect just any operator to work with structures.
Assignment is a special case
- Understand how to pass structure variables in and out of
functions
- Understand how this fits into what we know about pass-by-value,
pass-by-reference, and pass-by-address