Created
October 25, 2016 10:03
-
-
Save lucasscariot/e7e66c74f3702c59501a56ad6c664a1e to your computer and use it in GitHub Desktop.
This file contains 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 characters
struct s_flags | |
{ | |
char flag; | |
int (*p)(int a, int b); | |
}; | |
typedef struct s_flags t_flags; | |
t_flags flags[]= { | |
{'d', is_d}, | |
{'i', is_i}, | |
}; | |
#define TAB_SIZE(x) (sizeof(x) / sizeof(x[0])) | |
char c = 'i'; | |
while (i < TAB_SIZE(flags)) | |
{ | |
if (c == flags[i].flag) | |
flags[i].p(inta, intb); | |
i++; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment