Answers on accessing structs and unions via pointers
- For each of the following give the equivalent using the -> notation.
- (*sp1).fred
sp1->fred
- (*sp1).(*fred).age
sp1->fred->age
- For each of the following give the equivalent using the dot access operator.
- amy->next
(*amy).next
- amy->first.name
(*amy).first.name
Back to the questions.
Back to notes on accessing structs through pointers.