I am in the middle of writing a program which has a function which runs another function:
int executePuzzle(int input) {
switch (input) {
case 1: puzzle1();break;
case 2: puzzle2();break;
default:break;
}
}
However it may be more efficient to simply have something like:
int puzzle[2] = {puzzle1(),puzzle2()};
Then call puzzle0; I was wondering how this would be done.
It sounds like a place where function pointers would be useful