Why do people use enums in C++ as constants while they can use const?

前端 未结 12 1429
梦毁少年i
梦毁少年i 2020-12-08 02:28

Why do people use enums in C++ as constants when they can use const?

12条回答
  •  感情败类
    2020-12-08 02:59

    An enumeration implies a set of related constants, so the added information about the relationship must be useful in their model of the problem at hand.

提交回复
热议问题