From 2e8e2b5f3552bd9541a4eac6abba94a767dda8e4 Mon Sep 17 00:00:00 2001 From: Levi Bostian Date: Sat, 31 Aug 2013 20:51:11 -0500 Subject: [PATCH] Add enum to C. --- c.html.markdown | 4 ++++ 1 file changed, 4 insertions(+) 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 #include