struct point
{int X, Y;} a[4], b[4];
I found this piece of code on some program that works and I don't understand how this works and I can't find anything about how it works?
Can anyone explain it please?
struct point
{int X, Y;} a[4], b[4];
I found this piece of code on some program that works and I don't understand how this works and I can't find anything about how it works?
Can anyone explain it please?
That is the same as
struct point
{
int X, Y;
};
point a[4];
point b[4];
In other words, you define a structure (named point
) and then declare two variables a
and b
, both being arrays of four elements of the structure.
It is array of structure which can store 4 element of structure type for exampme x[0].a=10 and x[0].b=20....till x[3].