/* If you have any shortcomings, please kindly advise .*/
# Include <stdio. h>
# Include <string. h>
# Include <stdlib. h>
# Define IN 1
# Define OUT 0
# Define FNAME "enter the drug name (or number): n"
# Define SNAME "enter the drug name or number (end by-1): n"
# Define MENU "************************* n"
"1-add drug information. n"
"2-delete drug information. n"
"3-search for. n by drug name or number"
"4-update my drug information. n"
"5-total amount of drugs purchased. n"
"6-print my drug list. n"
"7-exit. n"
"************************* N"
"Select :"
Struct list_stag {// drug information
Char number [50];
Char name [30];
Char product [50];
Float price;
Int amount;
Struct list_stag * next;
};
Int GetDigit (const char * numstr );
Char * GetString (const char * putstr, char * gestr );
Struct list_stag * Insert (struct list_stag * fst, const struct list_stag * dst );
Struct list_stag * Delete (struct list_stag * fd, const char * destr );
Struct list_stag * SearchList (struct list_stag * serlist, const char * serstr );
Struct list_stag * Upated (struct list_stag * ulist, int * t, int sign );
Struct list_stag * GetValue (struct list_stag * ref );
Float PayList (struct list_stag * palist, char * s );
Void Print (const struct list_stag * fp );
Void PrintList (const struct list_stag * pst );
Void PayPrint (const char * str, float total );
Void FileSave (FILE * fPtr, const struct list_stag * f );
Main ()
{
FILE * file = fopen ("Medicine. DAT", "a + ");
Struct list_stag * list = NULL;
Struct list_stag red, * temp;
Int choice, I;
Float value, money;
Char string [3000];
While (fread (& red, 1, sizeof (struct list_stag), file) // read file information
List = Insert (list, & red );
<