What is the size of an enum in C?

前端 未结 7 1845
无人及你
无人及你 2020-11-22 08:55

I\'m creating a set of enum values, but I need each enum value to be 64 bits wide. If I recall correctly, an enum is generally the same size as an int; but I thought I read

7条回答
  •  星月不相逢
    2020-11-22 09:22

    We have no control over the size of an enum variable. It totally depends on the implementation, and the compiler gives the option to store a name for an integer using enum, so enum is following the size of an integer.

提交回复
热议问题