Why do C enumeration constants need a name? -


Why does the counting constant need a name? Because it:

  #include & lt; Stdio.h & gt; Nim {n, yes}; Int main (zero) {printf ("% d \ n", yes); }  

works like this:

  #include & lt; Stdio.h & gt; Enum boolean {No, yes}; Int main (zero) {printf ("% d \ n", yes); }  

If you want to create a type of 'enum', then That:

  value boolean x; X = No;  

An easy way to do this is with a type-tof:

  typingfum enum {NO, YES} boolean;  

And then you only need to use as a type of boolean:

  boolean x; X = No;  

Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

php - Multiple Select with Explode: only returns the word "Array" -

php - jQuery AJAX Post not working -