标签: delphi
Delphi在C中是否具有枚举类似物?
答案 0 :(得分:38)
是的,Delphi具有以下枚举类型构造:
type TDigits = (dgOne, dgTwo, dgThree <etc>);
此外,与C中一样,枚举类型的每个符号都可能具有 指定的值,如下所示:
type TDigits = (dgOne = 1, dgTwo, dgThree <etc>);
答案 1 :(得分:8)
是。查看Delphi Basics: Enumerations, SubRanges, and Sets.
答案 2 :(得分:4)
看看
Enumerations, SubRanges and Sets