Erythro/tests/switch.er

25 lines
452 B
Plaintext
Raw Normal View History

2023-12-07 22:33:51 +00:00
import "import/defs.eh"
int stuff[] = { 5, 7, 9 };
int :: main() {
2023-12-07 22:42:19 +00:00
for (int x = 0; x < 5; x++) {
int y = 0;
switch(x) {
case 1: {
y = stuff[0];
break; }
case 2:
y = stuff[1];
break;
case 3:
y = stuff[2];
default:
y = 100;
}
printf("%d\n", y);
}
return 0;
}