How do the two implementations differ:
struct queue {
int a;
int b;
q_info *array;
};
and
struct queue {
i
These are completely different things:
The reason people do this is it's more space-efficient. You simply over-allocate the memory the struct needs, and then pretend the array has more elements then declared - the compiler won't mind (usually).
It also means you have one less pointer to dereference through, and you can allocate and free the memory for the struct and the array all in one.
Obviously, this trick only works when the array is the last element in the struct.