why this syntax works?

why this odd syntax works? instead of writing a[i] i wrote i[a] but it still work normal why??

1
2
3
4
5
6
7
  char a[10];
cin>>a;
for(int i=0;i<10;i++)
{
	cout<<i[a];
}
}
It's wonky.

1
2
3
4
5
6
7
a[i]
// is the same as
*(a + i)
// is the same as
*(i + a)
// is the same as
i[a]
Dish!
thanks i understand ..
Topic archived. No new replies allowed.