Scilab: add %scilabconst in enum example
This commit is contained in:
parent
74aebf252d
commit
39bab12d2c
4 changed files with 40 additions and 15 deletions
|
|
@ -1,6 +1,7 @@
|
|||
/* File : example.c */
|
||||
|
||||
#include "example.h"
|
||||
#include "scilabconst_example.h"
|
||||
#include <stdio.h>
|
||||
|
||||
void enum_test(color c) {
|
||||
|
|
@ -14,3 +15,15 @@ void enum_test(color c) {
|
|||
printf("color = Unknown color!\n");
|
||||
}
|
||||
}
|
||||
|
||||
void scilabconst_enum_test(fruit f) {
|
||||
if (f == APPLE) {
|
||||
printf("fruit = APPLE\n");
|
||||
} else if (f == ORANGE) {
|
||||
printf("fruit = ORANGE\n");
|
||||
} else if (f == LEMON) {
|
||||
printf("fruit = LEMON\n");
|
||||
} else {
|
||||
printf("fruit = Unknown fruit!\n");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue