change:
Code:
void loadData(structure inventory,FILE *dataFile)
{
fgets(inventory.name, MAXchar,dataFile);
}
to:
Code:
void loadData(structure * inventory,FILE *dataFile)
{
fgets(inventory->name, MAXchar,dataFile);
}
and change:
Code:
loadData(inventory,dataFile);
to:
Code:
loadData(&inventory,dataFile);
damn, BEATEN! =)
sorry for the confusion earlier. correct the stuff that thantos pointed out and you should be on your way.
you were not modifying the structure in the 'main' function when you called 'fgets.' you were passing a copy of the structure, not a reference.
*waits for better explantion*