Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Hey there, C programming question. Q.) I need to construct a C statement to crea

ID: 3577077 • Letter: H

Question

Hey there,

C programming question.

Q.) I need to construct a C statement to create a structure type called equipment, which has three components: name (maximum length 10), number_in_inventory and unit_price. Be sure to use the appropriate data type for each component. I also need to write the C statement to create an array of this type called inventory_list, which can hold up to 5 items, which I am not sure how to do.

What I have so far:

struct equipment {

char name[10];

int number_in_inventory;

double unit_price;

}inventory_list[5]

Is this right or am I missing something?

Explanation / Answer


struct equipment{
char name[10];
int number_in_inventory;
float unit_price;
};

Now creating an array of equipment of size 5:

struct equipment inventory_list[5];