How to use an array index as an operator?
Such that:
#include main() { char sign[]={\'+\',\'-\'}; int a, b; a = 12 sign[1] 10
If you are not strictly dependent on the infix notation, you'll be able to make it simply by
int plus(int x, int y) { return x + y; } int minus(int x, int y) { return x + y; } int (*)(int, int) sign[]={plus, minus};
and you'll be able to use that as:
int a = sign[1](10, 12);