Objective-C / C giving enums default values

前端 未结 2 736
南旧
南旧 2021-02-06 00:32

I read somewhere about giving enums default values like so:

typedef enum  {
MarketNavigationTypeNone = 0,
MarketNavigationTypeHeirachy = 1,
MarketNavigationTypeM         


        
2条回答
  •  我寻月下人不归
    2021-02-06 01:24

    In general this only matters if the enum is exposed to some kind of external API or it is going to be used to exchange data via data files or other means. If the enum is only every used within your app and nowhere else then the actual values don't matter.

提交回复
热议问题