In C (and in all other languages I can think of), an array is actually a pointer to a bunch of memory. Indexing into the array calculates offset from the array pointer, and grabs the item at that offset.
int a[10]
There is a section of memory of size
sizeof(int) * 10
somewhere, and the variable a is a
* int
that points to that section. When someone does this: int x = a[2]
It is equivalent to: int x = *(a+(sizeof(int)*2))
When I said "array pointer" in my previous comment, all it meant was the memory address that the variable (which is an array) points to (in the example, the variable "a")Edit: missing paren
Read this:http://eli.thegreenplace.net/2009/10/21/are-pointers-and-arr...