If I have a C function where one argument is "...", how do I determine if more than two arguments are being passed to that function? If the third argument being sent to my_func()
would be int arg2
, how do I access it?
#include <stdio.h>
int my_func(int arg0, int arg1, ...)
{
/* How can I determine if 2 or 3 arguemnts are being passed to
* this function? How do I access the third argument so I could
* print it out? */
return 0;
}
int main() {
my_func(1,2);
my_func(1,2,3);
return 0;
}