I need to loop all the dynamic arguments i have gave to my function, how?
I mean this kind of code:
void something(int setting1, int setting2, ...){
// loop somehow all the ... arguments and use setting1-2 values in that loop
}
setting1 and setting2 are not part of the dynamic argument list.
Use va_ functions. Here’s an example:
Your other arguments have to indicate how many other args there are. printf, for example, uses the percents in the format string to do this. My example uses the first arg.
And lest you think that this type of argument passing is the bees knees, be sure to read varargs are bad, m’kay.