C++ Arrays of Structure access
- by learningtolive
Hi, I'm studying C++ from Schildt's book and don't quite understand what does he mean under third structure; Can somebody explain this -
To access a specific structure within
an array of structures, you must index
the structure name. For example, to
display the on_hand member of the
third structure, you would write cout
cout << invtry[2].on_hand;
Some code:
struct type{
char item[40];
double cost;
double retail;
int on_hand;
int lead_time;
}invtry[SIZE];