I'm trying to write a simply inventory program for my project. I've just started learning C. I'm in a real jam here as I did my additions for my program one way and every solution I'm finding for modifying records does seem to work with my file. Here is the code for adding items to the inventory file...I need some help with writing a module/function that will access the file and allow me to modify items and one that will allow me to delete entire records from the inventory.....I need it fast cause I'm facing a deadline...here is some of my code
Code:
/*
* ADDS CHEMICALS TO INVENTORY
*/

int add(void){
    fflush(stdin);
    FILE *Inventory;
    char name[40]={'\0'};
    char grade[6]={'\0'}, notes[50]={'\0'},units[3]={'\0'};
    float addchem[7],delchem[7];

    sys_time();

/*** For additions and deletions */  
    if ((Inventory=fopen("/Inventory.txt", "a"))==NULL){
       printf("Cannot open the file!\n");
       exit(EXIT_FAILURE);
    }
       while (getchar()!='\n');
       fflush(stdin);
       /*** Prompts for input */
       
       printf("Chemical(39 characters): ");
       fgets(name,sizeof(name),stdin);
       fflush(stdin);
       /*** no need to validate type for a chemical name may be alphanumeric */
       
       printf("Enter Grade: ");
       fgets(grade,sizeof(grade),stdin);
       fflush(stdin);
    //some kinda validation here//
    
       printf("Enter amount added: ");
       scanf("%f",&addchem[7]);
    /*** some kinda validation here */
    
       printf("Enter amount for Deleted: ");
       scanf("%f",&delchem[7]);
    /*some kinda validation here*/
       
       while (getchar()!='\n');
       printf("Enter Units(g,kg,ml,l): ");
       fgets(units,sizeof(units),stdin);
       fflush(stdin);

       printf("Enter Notes in no more than 50 characters: ");
       fgets(notes,sizeof(notes),stdin);
       fflush(stdin);
    /*some kinda validation here*/


    /*** writes values to file */
       fprintf(Inventory, "%s,%s/%f/%f/%s/%s;",name,grade,addchem[7],delchem[7],units,notes);
       fclose(Inventory);
    /*** Displays user entry */
       printf("\n\nYou entered the following information: \n");
       printf("Chemical:    %s\n", name);
       printf("Grade:   %s\n", grade);
       printf("Added:   %.2f%s\n", addchem[7],units);
       printf("Deleted: %.2f%s\n", delchem[7],units);
       printf("Notes:   %s\n\n", notes);
       
       printf("\nYour Inventory Entry was successful!\n");
       printf("Press any 'Enter' to continue...");
       getchar();
       while(getchar()!='\n');
       main();
      
return 0;      
}