Reinventing the wheel...
Posted on 1998-09-16
I am trying to do a add function that does what operator + do, but in this form : result = Add(a,b,c.....);
<don't ask me why ;) >
My question is:
1. How can I make it accept optional number of parameters?
(minimum is 2, no maximum)
2. How can I make it accept any numerical type such as int, long, float, double?
Thanks a lot,guys.
If anybody has the unix source for the operator '+', pls. post it as well so I can see how it is actually implemented... :)
Any code examples would be super..