im having a lot of trouble trying to find whats wrong with this program.
Code:
#include<stdio.h>
#include<math.h>
#include<conio.h>
struct inventory {
char itemname[20];
int qty;
float price;
};
int ask(inventory item[], int range);
int display(float total);
void main()
{
int t;
struct inventory item1[100];
printf("Hello and welcome to your inventory. \n");
printf("\nHow many items would you like to store? \n");
scanf("%i", &t);
ask(item1, t);
printf("Item Quantity Price Total\n");
getch();
}
int ask(inventory item[], int range)
{
int i = 0;
printf("\nWhat is your item name? > ");
fflush(stdin);
gets(item[i].itemname);
printf("\nHow many number of items you would like? > ");
scanf("%d", &item[i].qty);
printf("\nWhat is the price of your product? > ");
scanf("%f", &item[i].price);
return item[i].qty, item[i].itemname, item[i].price;
}
//int display(int total)
//{
// int i=0;
// total=item[i].qty*item[i].price;
//return total;
//}
//