For different parameters you can pass the parameters want as the second parameter and use stdargs.h to retrieve them. Also you can using templates for this.
C++ stdarg example:
#include <iostream>
#include <vector>
#include <string>
#include <stdarg.h>
void show(int n, ...) {
std::cout << "show:";
int val;
va_list vl;
va_start(vl, n);
for (int i = 0; i < n; i++) {
val = va_arg(vl, int);
std::cout << " " << val;
}
va_end(vl);
std::cout << std::endl;
}
int main() {
show(2, 1, 2);
show(4, 1, 2, 3, 4);
std::vector<void (*)(int, ...)> fns;
fns.push_back(show);
fns.push_back(&show);
fns[0](2, 1, 2);
fns[1](4, 1, 2, 3, 4);
(*fns[0])(3, 1, 2, 3);
(*fns[1])(1, 1);
return 0;
}