C++ How to get sizeof(enum) == sizeof(char)? -


i know how.

i have looked @ this topic, , understand "the choice of type implementation-defined.", curious know how 1 instead of 4.

c++11 introduced way change underlying type of enum.

enum foo : char { ... }; enum class foo : char { ... }; 

still, you're better off using default int in cases.


Comments

Popular posts from this blog

c# - SVN Error : "svnadmin: E205000: Too many arguments" -

c++ - Using OpenSSL in a multi-threaded application -

All overlapping substrings matching a java regex -