summaryrefslogtreecommitdiffhomepage
path: root/c.html.markdown
diff options
context:
space:
mode:
authorLevi Bostian <levi.bostian@gmail.com>2013-08-31 20:51:11 -0500
committerLevi Bostian <levi.bostian@gmail.com>2013-08-31 20:51:11 -0500
commit2e8e2b5f3552bd9541a4eac6abba94a767dda8e4 (patch)
tree6b13113737741ac5c0ecf7103b4192f53ee34aee /c.html.markdown
parent411d9a9813e8c7174f35540198b6dadc8c0b665c (diff)
Add enum to C.
Diffstat (limited to 'c.html.markdown')
-rw-r--r--c.html.markdown4
1 files changed, 4 insertions, 0 deletions
diff --git a/c.html.markdown b/c.html.markdown
index 4764c38e..0ac603a7 100644
--- a/c.html.markdown
+++ b/c.html.markdown
@@ -54,6 +54,10 @@ Multi-line comments look like this. They work in C89 as well.
// Constants: use #define keyword, no semicolon at end.
#define DAYS_IN_YEAR = 365
+//enumeration constants are also ways to declare constants.
+enum days {SUN = 1, MON, TUE, WED, THU, FRI, SAT};
+// MON gets 2 automatically, TUE gets 3, etc.
+
// Import headers with #include
#include <stdlib.h>
#include <stdio.h>