I've got a function with a variable list of arguments:

Execute(int arg1, int arg2, int arg3, int arg4, int argLast, ...)

I want to write another function that intercepts Execute. I want it to have the same argument list and pass all these arguments to Execute. For example something like this:

myExecute(int arg1, int arg2, int arg3, int arg4, int argLast, ...) {
printf("I will call execute now");

Execute(arg1,arg2,arg3,arg4,argLast, ...);

printf("I have called execute");
}

Is there a way to do that?

I was thinking of using the va_list but there's no ExecuteV function that would simply allow me to pass the whole va_list.
Please help...

I was afraid this would be the answer :( But thanks a lot :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.