You haven't set p to point to memory that contains the rec structures in which to place the values.