In the book, "Understanding and Using C Pointers" by Richard Reese it says on page 85,
int vector[5] = {1, 2, 3, 4, 5};The code generated by
vector[i]is different from the code generated by*(vector+i). The notationvector[i]generates machine code that starts at location vector , movesipositions from this location, and uses its content. The notation*(vector+i)generates machine code that starts at locationvector, addsito the address, and then uses the contents at that address. While the result is the same, the generated machine code is different. This difference is rarely of significance to most programmers.
You can see the excerpt here. What does this passage mean? In what context would any compiler generate different code for those two? Is there a difference between "move" from base, and "add" to base? I was unable to get this to work on GCC -- generating different machine code.


The quote is just wrong. Pretty tragic that such garbage is still published in this decade. In fact, the C Standard defines
x[y]as*(x+y).The part about lvalues later on the page is completely and utterly wrong too.
IMHO, the best way to use this book is to put it in a recycling bin or burn it.