Practical Programming-a medical management system

Source: Internet
Author: User

/* 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 );

<
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.