Auto variable with sizeof == 0

Gregory Smith greg at utcsri.UUCP
Tue Feb 10 10:23:30 AEST 1987


In article <397 at mipos3.UUCP> pinkas at mipos3.UUCP (Israel Pinkas) writes:
> [...]  (Remember that sizeof(array) =~ sizeof(element of array)
>times number of elements.  This is approximate because C allows a compiler
>to pack arrays.)

The relationship is exact: sizeof(array)==sizeof( array[0] )*(# of elements).
An array may not be packed in a way which makes this relationship inexact.

-- 
----------------------------------------------------------------------
Greg Smith     University of Toronto      UUCP: ..utzoo!utcsri!greg
Have vAX, will hack...



More information about the Comp.lang.c mailing list