I have a structure that looks as follows
typedef struct item
I create and populate the instance of my structure and call it myitem.
I save the file using fwrite(&myitem, sizeof(struct item), 1, fp) where fp is my file pointer. When I open the file and read in the struct using fread(&myitem, sizeof(struct item), 1, fp) and try to access myitem.name i get a segmentation fault. I have tried several things but cannot determine the problem.