ex 17.5.4 - dynamically allocated struct