this does exist in C++ only with the ellipsis, used e.g. for printf. But you’ll have to specify a format of the parameters passed. I’d suggest you to ask Google how to extract the arguments from a C++ function.
Thank you all, what I want to do is read a (different each time) number of root files; the input can be either int of char.
For the time being I only input an int (=number of root files) and read their names by cint
Finally I believe there is no point in looking for this, because “Non-static-const variable in array dimension” is also not allowed, so there aren’t any advantages in an arbitrary number of variables… However I thin kthis would be a useful feature.
Sure, this can also work although it’s not as practical (this script will be used many times for small number of files) – but the problem with all the alternatives is that a fixed number of TFiles and other objects will have to be created since the beginning, and most of them will not be used…
Another alternative is to use the following files[code]// File decl.C
std::vectorstd::string gFiles;[/code[
// File reg.C (registering the files
void reg(const char *file) {
gFile.push_back(file);
}and a file named (for example) actualUse.C and use it as follow:root.exe decl.C reg.C\(\"file1.root\") reg.C\(\"file2.root\") actualUse.C
root.exe decl.C reg.C\(\"file1.root\") reg.C\(\"file2.root\") reg.C\(\"file3.root\") actualUse.C
Another alternative is to write a small shell script that takes the file names as input, create a (temporary) text file and pass this text file to your macro and root.exe