For example,a function that can take unlimited (or, more precisely, a very big number) amounts of the same type arguments, let's say integer, and then make all the passed integers have a value of 5.
What i ask is, can i,if i can,make a function with a non-fixed amount of parameters.
void setIntToFive(UNKNOWN AMOUNT OF INTS){
//a for loop to assign a value to all the passed arguments
}
Then call it with different amounts of arguments every time
int a;
int b = 5;
setIntToFive(a,b);
int c;
setIntToFive(a,b,c);//Notice how i add another argument.
So, is there a way to make this, besides making the parameter an array.(i think it wouldn't work that way)