[comp.lang.c] sizeof aggregate

gwyn@brl-smoke.ARPA (Doug Gwyn ) (06/27/88)

In article <1190@mcgill-vision.UUCP> mouse@mcgill-vision.UUCP (der Mouse) writes:
>... I find no guarantee that sizeof(double[5]) == 5*sizeof(double).

sizeof array_object produces the total number of bytes in the array object,
which the is number of members times the size of one member.  This says
something about what sizeof has to report for the size of an object that
can meaningfully be arrayed.  sizeof struct_or_union includes internal and
trailing padding, so this is already accounted for when taking sizeof
array_of_struct_or_union.  All this is guaranteed by the dpANS.