added functions

This commit is contained in:
Win 2024-08-29 20:04:02 +07:00
parent f3ab5d2efd
commit e0ca79c4d0
1 changed files with 12 additions and 1 deletions

View File

@ -63,6 +63,7 @@ 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];
@ -80,6 +81,9 @@ int main()
printf("%-50s %s\n", vendor_info, vendor_stock);
}
char user_purchase[50];
fclose(fp);
free(file_buffer);
return 0;
@ -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)
{
}