- Feb 7, 2001
- 1,637
- 0
- 0
Some C++ functions I've noticed take a random length list of arguements, for instance the .NET Console::Write method, you can do:
Console::Write ("just one");
Console::Write ("one", "two", aString, "three");
Console::Write ("yet", "another", "example", "using", "bunch", "of", arguments");
etc. etc.
cout does the same, you can say:
cout << " string one " << "string two";
I want to write a function that can take any random number of arguments like this... how?
function myFunction ( [ what do I put for arguments, and how to I access them? ] )
{
// stuff goes here
}
Console::Write ("just one");
Console::Write ("one", "two", aString, "three");
Console::Write ("yet", "another", "example", "using", "bunch", "of", arguments");
etc. etc.
cout does the same, you can say:
cout << " string one " << "string two";
I want to write a function that can take any random number of arguments like this... how?
function myFunction ( [ what do I put for arguments, and how to I access them? ] )
{
// stuff goes here
}