I am writing a C program that will take a variable number of command line arguments. I need to then take these arguments and pass them into a function that takes a variable number of filenames as individual parameters (using va_arg to get the arguments inside the function), prototyped as:
void FindFile(char *filename1, ...);
My implementation of FindFile is fine. My question is, how do I take the variable number of arguments in the main method's 'char *argv[]' and use them as parameters when calling FindFile?
This is an assignment for a class, so the FindFile prototype can not be changed. I have searched for ways to make this work, only finding one answer, which said that it is impossible to do. Is this actually the case? It is the exact specification given by my professor so I assumed it would be possible somehow, but the exact method was not discussed in class.