Writing and reading (fwrite - fread) structures with pointers
I'm working on a mailbox project, and I have these two structures: struct mmbox_mail struct mmbox_mail { char *sender, *recipient; char *obj, *date; char flags; size_t size; }; and mail_t typedef struct{ struct mmbox_mail info; void *body; void *next; } mail_t; I cannot modify the structures' fields, because I need variable data (for this purpose I used char* instead of char[]). Each mail_t structure is a mail. I need to save every mail of a user in a file, that could be binary or text file (but I think it's better with a binary file, because I have the void* body that is difficult to save in