I came across a different way of accessing an array element today. I am just curious if its correct way to access an array element.
Here is my code,
#include <stdio.h>
int main(int argc, char* argv[])
{
int arr[4] = {4, 5, 6, 7};
printf ("---> %d \n", 2[arr]);
return 0;
}
Following is the output,
---> 6
I thought the program will not compile but it did! I tried to compile it on Linux and Windows and it works fine on both. Expert views on this?