I have this structure which I want to write to a file:
typedef struct { char* egg; unsigned long sausage; long bacon; double spam; } order; <
If you are using C99 you can output real numbers in portable hex using %a.
%a