Talk:Enumerated type
From Wikipedia, the free encyclopedia
[edit] Context template
Specific confusing sentences:
- "Typically the compiler will select a small integer to represent each enumeration value at run-time, but this representation is not always visible to the programmer." Why does the compiler do this? Why isn't it visible to the programmer?
-
- Answer: For example, the purpose of the three symbols (apple,orange,banana) is to identify a fruit, not a number! How the values (fruits) are represented is not important to anyone but the compiler and the CPU, hence it is hidden from the programmer. This can be compared to the binary representation of characters or real numbers (or jpg-pictures or MP3-songs for that matter), normally not so interesting to the programmer or user either. / HenkeB 17:02, 2 March 2007 (UTC)
- "In some languages, the boolean type of truth values is considered a predeclared enumerated type of two values." What is a predeclared enumerated type?
-
- Answer: As if somebody had written type boolean = (false,true) at the beginning of every source file.
Foxjwill 18:14, 18 December 2006 (UTC)
[edit] Improved Context
I attempted to improve the context. Can we remove the note now? Dw31415 17:17, 10 October 2007 (UTC)