I am looking to do this in C/C++.
I came across Variable Length Arguments but this suggests a solution with Python & C using libffi.
Now, if I want to wr
In C++11 this is one possible solution using Variadic templates:
template
void myprintf(const char* fmt, Args... args )
{
std::printf( fmt, args... ) ;
}
EDIT
As @rubenvb points out there are trade-offs to consider, for example you will be generating code for each instance which will lead to code bloat.