It works because C structs are just contiguous bits of memory, interpreted as various fields
Well... almost. C structs can have internal padding -- but the C standard doesn't allow padding before the first element, so that first element is guaranteed to begin at the beginning of the struct.
This works: The memory from location to location+sizeof(parent) IS a parent struct. The child fields following the parent struct are simply ignored.