I would like to write something like this;
for (op1 in (plus, minus, times, divby, exponent)) {
printf("%d", a op1 b);
}
so that what actually ends up being executed is something like this
printf("%d", a + b);
printf("%d", a - b);
printf("%d", a * b);
printf("%d", a / b);
printf("%d", a ^ b);
How can I write this?
Array of function pointers would do.