>>72
C++で関数の多重定義を使え。
もしくはvoid *で渡しておき、パラメータで切り替える。

void func(void *p, int i)
{
double d;

switch (i) {
case 1:
d = *(double *)p;
break;
]
}