Created
April 15, 2013 16:51
-
-
Save romyilano/5389503 to your computer and use it in GitHub Desktop.
From Creating iOS5 apps Develop & Design - thanks! review of enumeations
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Enumerations provide a concise, elegant method for defining a discrete set of values | |
| typedef enum { | |
| SUNDAY, | |
| MONDAY, | |
| TUESDAY, | |
| WEDNESDAY, | |
| THURSDAY, | |
| FRIDAY, | |
| SATURDAY | |
| } DAY; | |
| const DAY HUMPDAY = WEDNESDAY; | |
| // enum asisgns 0 to first constant, valus increase by 1 | |
| // you can also assign explicit values to 1 or more named constants | |
| typedef enum { | |
| BOLD = 1; | |
| ITALIC = 2; | |
| UNDERLINE = 4; | |
| ALL_CAPS = 8; | |
| SUBSCRIPT=16; | |
| STRONG = BOLD; | |
| } STYLE; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment