Using sizeof() on a parameter array

der Mouse mouse at thunder.mcrcim.mcgill.edu
Sat May 25 22:44:05 AEST 1991


In article <WORLEY.91May20111036 at sn1987a.compass.com>, worley at compass.com (Dale Worley) writes:

>     struct dummy { char a[80]; };

>     void test(struct dummy param) {
> 	    printf("sizeof(param) = %d\n", sizeof(param));
>     }

> will print 80 as expected!

Or possibly more, if the compiler chooses to pad the structure :-)

(For example, if every object is rounded up to a power of two, as I
recall someone, ages ago, saying some twisted machine did....)

					der Mouse

			old: mcgill-vision!mouse
			new: mouse at larry.mcrcim.mcgill.edu



More information about the Comp.lang.c mailing list