Process help

i have to process communicating through pipe(create with pipe(fd)), i want to send a struct type instead of primitives types.My attempts to do it have failed, does anyone knows how to do it?