sizeof aggregate (was: Should I convert FORTRAN code to C?)

Doug Gwyn gwyn at brl-smoke.ARPA
Mon Jun 27 05:32:12 AEST 1988


In article <1190 at mcgill-vision.UUCP> mouse at 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.



More information about the Comp.lang.c mailing list