Is there an easy way to print enumeration values symbolically?
No. You can write a little function (one per enumeration) to map an enumeration constant to a string, either by using a switch statement or by searching an array. (For debugging purposes, a good debugger should automatically print enumeration constants symbolically.) comp.lang.c FAQ list ยท Question 2.25 Q: I came across some structure declarations with colons and numbers next to certain fields, like this: struct record { char *name; int refcount : 4; unsigned dirty : 1; }; What gives? A: Those are bit-fields; the number gives the exact size of the field, in bits. (See any complete book on C for the details.) Bit-fields can be used to save space in structures having several binary flags or other small fields, and they can also be used in an attempt to conform to externally-imposed storage layouts. (Their success at the latter task is mitigated by the fact that bit-fields are assigned left-to-right on some machines and right-to-left on others). Note that the colon notation for specifying