I'm reading Head First C and going well so far but I'm having trouble with this example -
int doses[] = {1, 3, 2, 1000};
printf("Issue dose %i", 3[doses]);
Result = "Issue dose 1000"
I know what this does, it accesses index 3 of the doses array. More technically my understanding is that it adds the size of three integers to the pointer address for the first element in the array ( the doses variable )
The book explains that it works because
doses[3] == *(doses + 3) == *(3 + doses) == 3[doses]
I'm with it up until that final jump between *(3 + doses) == 3[doses]. Given that doses[3] is easy for me to grasp maybe I'm not understanding the significance of the [] correctly?