SHARE
TWEET

enum_ii

chipant May 31st, 2020 854 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. typedef enum {
  2.     GEN = 0,   
  3.     CYL,           
  4.     mCG_EXCEPTION = 0xFFFF
  5. } mCG;
  6.  
  7. mCG var1 = GEN;
  8.  
  9. int main(){
  10.   printf("%d\r\n", sizeof(var1));   // Prints : 2
  11.   printf("%d\r\n", sizeof(GEN));    // Prints : 4
  12.   printf("%d\r\n", sizeof(mCG));    // Prints : 2
  13. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top