source:
CIVL/mods/dev.civl.abc/examples/side-effects/enums.c
| Last change on this file was aad342c, checked in by , 3 years ago | |
|---|---|
|
|
| File size: 167 bytes | |
| Rev | Line | |
|---|---|---|
| [aad342c] | 1 | #include <assert.h> |
| 2 | ||
| 3 | typedef enum color {RED, BLUE} color_t; | |
| 4 | ||
| 5 | color_t f() { | |
| 6 | return RED; | |
| 7 | } | |
| 8 | ||
| 9 | int main() { | |
| 10 | int x=0; | |
| 11 | ||
| 12 | if (f()==RED) { | |
| 13 | x=1; | |
| 14 | } | |
| 15 | assert(x==1); | |
| 16 | } |
Note:
See TracBrowser
for help on using the repository browser.
