I'd start by changing this:
Code:
typedef struct{
int prod_no;
char prod_name[30];
char prod_brand[30];
int quantity;
float price;
full_date date_added;
}inventory;
To this:
Code:
typedef struct {
int prod_no;
char prod_name[30];
char prod_brand[30];
int quantity;
float price;
full_date date_added;
} product;
typedef struct {
product *products;
int size;
} product_inventory;
Now, your function becomes:
Code:
void UpdateProduct(product_inventory *inventory)
In main, you would write:
Code:
product_inventory inventory;
inventory.size = 123; // for example
inventory.products = malloc(sizeof(inventory.products[0]) * inventory.size);
// ...
UpdateProduct(&inventory);
// ...
free(inventory.products);
If you have not learnt about malloc and free, then it is even easier: just declare products to be an array with a fixed size, then use size to denote the number of elements in use.