How can I code a function that accept not defined parameters ? I imagine it could work like that :
void foo(void undefined_param)
{
if(typeof(undefined_param) == int) {/...do something}
else if(typeof(undefined_param) == long) {/...do something else}
}
I'have read that templates could maybe solve my problem, but in C++ and I need it in C.
I'm just trying to avoid coding two functions with a lot of similar codes. In my case, I wont be looking for int
or long
but struct types that I defined.