Created
November 25, 2013 19:30
Revisions
-
cbarrett created this gist
Nov 25, 2013 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,20 @@ /* Let's say you want to list all of the options to your program as an enum */ enum Option { OptionFoo, OptionBar, CountOfOption } /* You want to write a procedure to generate a help message for your program. Here's one way: */ for (int option = 0; i < CountOfOption; i++) { switch (option) { case OptionFoo: /* print foo usage */ break; case OptionBar: /* print bar usage */ break; } }