Q:

What do 2[p] and 6[p] mean?

#include <stdio.h>
int main(void) 
{
   char c[]="GATECSIT2017";
   char *p=c;
   printf("%s", c+2[p]-6[p]-1);
   return 0;
}

What do 2[p] and 6[p] mean?
Please provide a detailed explanation.
Output: 17

A:

For any valid pointer or array p and index i, the expression p[i] is equal to *(p + i). And due to the commutative property of addition *(p + i) is equal to *(i + p) which is then equal to i[p].
In short, 2[p] is the same as p[2].

