Why we can't have “char” enum types

前端 未结 9 1011
不知归路
不知归路 2020-12-06 03:50

I want to know why we can\'t have \"char\" as underlying enum type. As we have byte,sbyte,int,uint,long,ulong,short,ushort as underlying enum type. Second what is the defau

9条回答
  •  感动是毒
    2020-12-06 04:33

    Character enums would simply be strings wouldn't they? I'm not sure what other benefit you would derive from a character enumeration?

    As others have said, the default type is int for an enumeration.

提交回复
热议问题