How can I make a growing argument list without overloading?

Hey, I'm not sure for a function how many arguments I will need. Is there a way to possibly have a function that can have an infinite amount of arguments without writing an infinite amount of overloaded functions? Is that possible, or would some way of adding functions to do what I needed have to be done?
I was thinking of using a pointer as an argument that can have pointer arithmetic to go the next actual objects in memory etc.
Would that work or any ideas?
Thanks
You can use infinite parameters like this.
1
2
3
4
int someFunction(int something, ...)
{
    //something
}

check http://www.cplusplus.com/reference/clibrary/cstdarg/va_list/ for information about the ...
The correct term is "arbitrary", not "infinite". It's not possible to pass infinitely many parameters.

If all the parameters will be of the same type, simply pass a reference or pointer to a vector.
Passing arbitrary parameters of various types is more complicated and there are several solutions of varying complexity.
Topic archived. No new replies allowed.