hi
my name is enam. i hv a qs:
Difference between Array & Structure
any reply will be appreciated
C's concept of a "struct"ure is, what in Computing Science parlance is
referred to as an "ordered, heterogenous array". C's concept of an
array is what is what in Computing Science palance is referred to as a
"homogeneous array".
Yes, you could support unordered heterogenous arrays in C by casting
pointers in an array, etc.
The main advantage of a C struct is that you can define the pieces to
whatever level of detail you happen to care to (subject to some
usually reasonable limitations). The main disadvantage is that you
MUST do so.
C arrays also permit nesting, but you are stuck with the limitation
that all of the elements will be of the same time. You can, however,
have arrays of structs of arrays of structs also.