Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

yes, I realized this after asking the question :).I must admit I never thought it in this way.

Thinking more about this, this might fail if the compiler uses post-incrementing load/stores which update the pointer addresses too. Or will it not use them if I am using index[arr] ?

Lets say the load/store updates the pointer too. So after first execution, ptr will index+arr in both cases, but during the next iteration , the former will be ptr[index] while the latter will be ptr[arr].



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: