Function lookup table with different function prototypes
What is the best way to call a specified function based on user input except from series of if and strcmp ? For example: p 2 2 -> call func_p(2, 2) a 8 -> call func_a(7) m -> call func_m(void) I know it's easy and elegant to make a lookup table consisting of function pointers with the same prototype but how about different prototypes? I thought about using ... in a prototype but I don't know if it's a good solution. Define all the functions so they take a single array argument. Comment from Barmar Unifying all functions to the same prototype is exactly what one normally does in this case,