Is there any way to achieve function overloading in C? I am looking at simple functions to be overloaded like
foo (int a) foo (char b) foo (float c , i
In the sense you mean — no, you cannot.
You can declare a va_arg function like
va_arg
void my_func(char* format, ...);
, but you'll need to pass some kind of information about number of variables and their types in the first argument — like printf() does.
printf()