In raw C, a designation []is just a helper pointer helper. Before []you have to look for the fourth char in the block pointed to by ptr, for example:
*(ptr+4)
Then they entered a shortcut that looked better:
ptr[4]
What transalts to an earlier expression. But, if you write it like this:
4[ptr]
This will translate to:
*(4+ptr)
This is really the same.
source
share