Number of enums
Bob Stout
Bob.Stout at p6.f506.n106.z1.fidonet.org
Wed Jan 23 00:43:14 AEST 1991
On <Jan 21 04:51>, Dave P. Schaumann (dave at cs.arizona.edu ) wrote to All:
DPS> For instance, suppose I have:
DPS> typedef enum { SUN, MON, TUE, WED, THU, FRI, SAT } days_t ;
DPS> And now I want to declare an array like:
DPS> float high_temps[<# of days>] ;
Try for example:
typdef enum CARS { FORD, CHEVY, PLYMOUTH, CARS_MAX };
long registered_vehicles[CARS_MAX];
Want to add more, no problem...
typdef enum CARS { FORD, CHEVY, PLYMOUTH, FERARRI, YUGO, CARS_MAX };
More information about the Comp.lang.c
mailing list