Skip to content

Commit

Permalink
Improved example.
Browse files Browse the repository at this point in the history
  • Loading branch information
janpgit committed May 5, 2024
1 parent f2e951a commit 86368bc
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions modules/enum.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ enum months {
NOV,
DEC,
};
/* See how you define a variable of an enum. */
enum months mymonth = FEB;
```

You could also do as follows:
Expand All @@ -45,6 +48,8 @@ enum weird {
seven = -1,
...
}

enum weird myweird = six;
```

The list consists of *enumerators*. I.e. both `JAN = 1` and `FEB` are
Expand Down

0 comments on commit 86368bc

Please sign in to comment.