home.social

#enumerations — Public Fediverse posts

Live and recent posts from across the Fediverse tagged #enumerations, aggregated by home.social.

  1. C programmers, please help me figure out something:

    Since C23, a C enum may be declared to have a specific underlying type, as in the following example. My question is, how can I find the underlying type of such an enum? (C++11's std::underlying_type trait gets me this information.) 🙏

    ```C
    enum Size : char { small, medium, large );
    ```

    Code example in C++ and C: sigcpp.godbolt.org/z/eo7Tdqaeb

    C enum: en.cppreference.com/w/c/langua

    #question #c #programming #cpp #cplusplus #enumerations #enums