|
[Sponsors] |
November 25, 2011, 03:54 |
c/c++/Fortran efficient indexing
|
#1 |
Senior Member
Join Date: Mar 2009
Posts: 151
Rep Power: 17 |
Hey,
If I want to access an integer array several times in a loop is is more efficient to use a variable to hold the integer value, e.g.: int array[]; int k; for(i) { array[i]=k; (k+5)/k+k^4; } rather than for(i) { (array[i]+5)/array[i] + array[i]^4; } ? Thank you!
__________________
"Trying is the first step to failure." - Homer Simpson |
|
|
|