Typesafe enums in C?

后端 未结 6 615
我寻月下人不归
我寻月下人不归 2021-01-12 02:29

If I have more than one enum, eg:

 enum Greetings{ hello, bye, how };

 enum Testing { one, two, three };

How can I enforce th

6条回答
  •  独厮守ぢ
    2021-01-12 02:53

    You can typedef your enums and then declare variables and function arguments of those types.

提交回复
热议问题