Point me in the right direction
Mark H. Colburn
mark at jhereg.Jhereg.MN.ORG
Sat Feb 25 00:27:41 AEST 1989
In article <3735 at arcturus> evil at arcturus.UUCP (Wade Guthrie) writes:
>> Of course, adding:
>> #define N_FCONSTS (sizeof(fund_consts)/sizeof(double))
>This is all well and good, but what about arrays of structures? Am I
>S.O.L. because of inter-array-element padding if I:
It may be easier to use
#define N_WHATEVER (sizeof(snarf)/sizeof(snarf[0]))
This works for any array that has a static size and constant sized
elements (the majority of the cases where you would want to use this kind
of trick anyways).
--
Mark H. Colburn "Look into a child's eye;
Minnetech Consulting, Inc. there's no hate and there's no lie;
mark at jhereg.mn.org there's no black and there's no white."
More information about the Comp.lang.c
mailing list