s*******e 发帖数: 664 | 1 ☆─────────────────────────────────────☆
jindj (见过没) 于 (Thu Jan 7 23:06:33 2010, 美东) 提到:
which one is faster in the example?
float f[10000];
going through its elements over and over using:
1. f[i] 下标变量
2. *(f+i) 指针位移
Long long ago, I had been told in class that the 2nd is faster; I did some
tests but the results are not consistent - it seems true for a "float" array
, but it's opposite for a "double" array. weird.
☆─────────────────────────────────────☆
bullmj (牛马甲) 于 (Thu Jan 7 23:25: |
|