added functions
This commit is contained in:
parent
f3ab5d2efd
commit
e0ca79c4d0
13
vendorInfo.c
13
vendorInfo.c
|
@ -62,7 +62,8 @@ int main()
|
|||
|
||||
int total_vendors = index - 1;
|
||||
printf("\n>>> Read %d vendors from file %s\n", total_vendors, file_name);
|
||||
|
||||
|
||||
// print out each vendor's info
|
||||
for (int i = 0; i <= total_vendors; i++)
|
||||
{
|
||||
char vendor_info[200];
|
||||
|
@ -79,6 +80,9 @@ int main()
|
|||
|
||||
printf("%-50s %s\n", vendor_info, vendor_stock);
|
||||
}
|
||||
|
||||
char user_purchase[50];
|
||||
|
||||
|
||||
fclose(fp);
|
||||
free(file_buffer);
|
||||
|
@ -100,3 +104,10 @@ int read_input(char str[], int n)
|
|||
str[i] = '\0';
|
||||
return i;
|
||||
};
|
||||
|
||||
int purchase(struct vendor_item vendors, int index, char str[], int amount)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue