I don't really know how to even begin solving this problem. Basically, I have a structure:
I want to fill out the fields of the structure...
The problem here is that when I assigned new->prev and new->next to NULL, the value of new->name changes! Apparently it is resetting the value to NULL. I'm not sure why at all, but it is causing segmentation faults.
fgets (input, 255, file); if ((p = strchr(input, '\n')) != NULL) *p = '\0';
new=createitem("NULL", "NULL", currentarea);
new->loc=&a[currentarea]; printf("%s", new->name);
new->prev=NULL; new->next=NULL; printf("%s", new->name);