Answer:
Following are the function to the given question:
void same_quantity_inventory(inventory *arr, int size)//defining a method same_quantity_inventory that takes two parameters
{
inventory *p = arr;//defining a pointer variable that holds array value
while (p < arr + size)//defining while loop that checks pointer value less than arr and its size
{
if (p->endQty == p->beginQty)//use pointer to check array start and end value
printf("name: %s, start quantity: %d, end quantity: %d\\", p->name, p->beginQty, p->endQty);//print value
p++;//incrementing pointer value
}
}
Step-by-step explanation:
In the given code a method "same_quantity_inventory" takes two parameters that are "arr and size". In the next step, a pointer variable "p" is declared that holds the "arr" value. It defines the while loop that checks pointer value less than arr and its size inside the loop and if block is declared that use pointer to check array start and end value, and prints its calculated value.