Hi
Just as a curiosity, did anyone understand the exercise 10 in chapter 5?
to make the whole story real short, here's what it is about :
Code:
int main (int argc, char* argv[])
{
cout << sum(2,4,6,8,10,12) << endl;
cout << sum(11,22,33,44,55,66,77,66,99) << endl;
}
** edit**
Strangely, the c++/cli example that uses the sum function works perfectly.
There must be an erratum section on this site, I think I'll try to find it.
Mister Hortons says that this example should produce the following output
10
172630728
My question is : why would sum(2,4,6,8...) only result in 10 ??
I didn't include the function sum in my example, but I would assume a sum function to calculate the sum of all arguments supplied to the function.
Em I missing anything? Most probably ;)
Thanks
Charles