In C, when you declare an array of type int like so
int n = 500;
int *a = malloc(n*sizeof(int));
the name a stores the heap memory address of a chunk of memory. When you use the sqaure-bracket operator as in a[k], you "go" to address a. Baked into the pointer data type is knowledge of the size of the type you have in your array; hence a[k] means ...