enums

jonab at sdcrdcf.UUCP jonab at sdcrdcf.UUCP
Thu Jul 7 03:02:42 AEST 1983


enums would be much better if you were allowed to use the "++" and
"--" operators on them to implement the pascal pred and succ functions.
Also, you cannot use them in array subscripts.
I would like to be able to write:

enum color {red, white, blue};
enum color hue;
int palate[color];

	hue = red;
	do {
	    if (palate[hue]) {
		/* some code */
	    }
	    if (hue != blue)
		hue++;
	} while (hue != blue);

As they stand, they are not overly useful without a lot of ugly type
conversion.



More information about the Comp.lang.c mailing list