If you have ever scripted with Javascript you are aware of the arguments array that a function possesses. Basically, you could do something like this in Javascript:
Anyway as you can see above, this function will basically display a message box alerting the user of each entered argument, despite that I did not define them specifically.Code://Define function myFunc() { for(i=0; i<myFunc.arguments.length; i++) { alert("Argument "+i+": "+myFunc.arguments[i]) } } //Call myFunc("this is an arg") myFunc("so is this","and this","and this.") myFunc("here","are","several","args","with","no","specific","limit.")
Now I am looking to do this in C++ for an array building type thing, so my question is, how can I make a repeating argument (with a given data type of course).



LinkBack URL
About LinkBacks


