Interview Questions

Is there an easy way to print enumeration values symbolically?

C Interview Questions and Answers


(Continued from previous question...)

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.)

(Continued on next question...)

Other Interview Questions