Such a function is variable, but such functions are much less useful than they might seem at first glance. The wikipedia page on this topic is not bad and has a C code.
The main problem with such functions is that the number of parameters cannot actually be variable - they must be fixed at compile time by a known parameter. This is obvious in printf:
printf ("% s% d", "Value is", 42);
The number of% specifiers must correspond to the number of actual values, and this is true for all other applications of variational functions in C in one form or another.
anon
source share