Name of this function?
Hey, I know there is a function that can except X number of arguments and add up the sum of them...similar to the way printf works, only it can take integers. Does anybody know the name of this function, and how in the world you use it. I remember reading a tutorial somewhere before...it had something to do with a protocal like this.
and then you had to do a whole bunch of other stuff..which i can't remember what other stuff. Actually now that I think about it, this function only allows you to accept X number of arguments, you can just add them all up.
void function(int number, ...);
There is no such standard function. The stl provides accumulate in the numeric header, but this works for itterator pairs (vectors, arrays, etc..)
i don't wanna sound like i know what i'm talking about...but i am almost certain there is such a technique...
should give you all the information you need on variable arguments list functions.
You should look at the tutorial before posting a question. You'll probably have to #include <cstdarg> instead of <stdarg.h>
I did take a look quick actually, must have missed it. sorry.