I recently came across this page . And I was particularly interested in the section on access to direct parameters.
I'm just wondering if there is a way to execute only one of the functions depending on the value of n in the following line:
printf("%n$p", func1, func2, func3 .. funcN);
where func1, .. have a signature like int func1 (), int func2 (), etc. This is a limitation, since I might also want to have a tha return void function.
The line above prints only the address of the function; The function is not called ..
I even tried using the "," (comma operator) to achieve this; but in this case, all functions in the list will receive a call, and the result corresponding to "n" will be printed.
Is there a way to actually execute a function inside printf (..)?
Thank.
source
share