Point me in the right direction

John Hascall hascall at atanasoff.cs.iastate.edu
Sat Feb 18 01:39:14 AEST 1989


In article <1841 at mit-caf.MIT.EDU> vlcek at mit-caf.UUCP (Jim Vlcek) writes:
>rbutterworth at watmath.waterloo.edu (Ray Butterworth) writes:
>
>>Another handy style guideline to follow is trying to avoid writing
>>empty [] declarations.

>                         ... In fact, for an array which is fully
>initialized at compile time, an empty [] declaration is preferable:

>double fund_consts[] = {
>	3.14159265,
>	2.7182818,
>	6.02E23,
>};

   Of course, adding:

     #define N_FCONSTS (sizeof(fund_consts)/sizeof(double)) 

   then you can use stuff like:

     extern fund_consts[N_FCONSTS];

   elsewhere.



John Hascall
ISU Comp Center



More information about the Comp.lang.c mailing list