It is fine to open and close the file within a function, but if you do so, then the FILE * that you are using for this should not be one that is passed from another function that also holds an already opened handle to the same file. You should NEVER open the same file more than once [unless you ABSOLUTELY KNOW what you are doing - and you have a quite few more lessons until you reach that stage].
However, if it is the same file that you open and close in each function, then it would be preferable to open the file once.
Code:
edit_info(&slot);
fseek(main_program,(verify-1)*sizeof(Inventory),SEEK_SET);
fread(&slot,(verify-1)*sizeof(Inventory),1,main_program);
fread does not WRITE to the file.
Yes, but the "append" effect is negated by fseek(file, 0, SEEK_SET), which sets your file-position to the beginning of the file. And you do this twice in the "fill" function.
--
Mats