
28 Jan
2008
28 Jan
'08
9:32 p.m.
AMDG Ovanes Markarian wrote:
Sorry, but your test was wrong. Try to pass the array to sum as const reference. In your case you always copy the array!!! It should not be faster.
Wrong. An array argument to a function is really a pointer. In Christ, Steven Watanabe
On Jan 28, 2008 9:55 PM, Hicham Mouline
mailto:hicham@mouline.org> wrote: Hi, thanks for your answers,
Because I had tested just with :
1. static double sum(double d1, double d2, double d3) { return d1+d2+d3; }
vs
2. static double sum(double d[3]) { return d[0]+d[1]+d[2];
}