Let's say I have to do the same operation op on the n+1 elements of an array arr.
Is there a difference of speed at execution between :
op(arr[0]);
op(arr[1]);
...
op(arr[n]);
and
for(i=0; i<=n; i++) {
op(arr[i]);
}
Or is the compiler smart enough to detect the for loop (given n is fixed at compile time) and convert it to the linear execution (if it is actually faster)?