Can I define the size of an enum in c++?

后端 未结 2 1520
悲&欢浪女
悲&欢浪女 2021-01-03 22:27

From what I know (from what I read in the cpp-programming-language) the size would be the size of \"some integral type that can hold its range and not larger than sizeof(int

2条回答
  •  滥情空心
    2021-01-03 22:56

    In C++11 you can use an enum class, where you can specify the underlying type. In C++03 there is no solution.

提交回复
热议问题