Why the array index is faster than pointer? Isn\'t pointer supposed to be faster than array index?
** i used time.h clock_t to tested two functions, each loop 2 mil
It may be the comparison in the for loop that is causing the difference. The termination condition is tested on each iteration, and your "pointer" example has a slightly more complicated termination condition (taking the address of &a[size]). Since &a[size] does not change, you could try setting it to a variable to avoid recalculating it on each iteration of the loop.