Interview Questions

Are enumerations really portable?

C Interview Questions and Answers


(Continued from previous question...)

Are enumerations really portable?

Q: Are enumerations really portable? Aren't they Pascalish?

A: Enumerations were a mildly late addition to the language (they were not in K&R1), but they are definitely part of the language now: they're in the C Standard, and all modern compilers support them. They're quite portable, although historical uncertainty about their precise definition led to their specification in the Standard being rather weak (

(Continued on next question...)

Other Interview Questions