Perfectly valid C. From Wikipedia:
Similarly, since the expression a[i] is semantically equivalent to *(a+i), which in turn is equivalent to *(i+a), the expression can also be written as i[a] (although this form is rarely used).
Wacky, but valid.
More Related Contents:
- Is it possible to use notation [] with pointers in C?
- C array pointer increment
- I need help understanding this code in C [closed]
- C | Static array: why does writing out-of-bounds not result in exception? [duplicate]
- C-programming board game [duplicate]
- Is an array name a pointer?
- Returning an array using C
- Getting a stack overflow exception when declaring a large array
- How do I work with dynamic multi-dimensional arrays in C?
- Using malloc for allocation of multi-dimensional arrays with different row lengths
- Exceptions to array decaying into a pointer?
- Why do arrays in C decay to pointers?
- What is the maximum size of an array in C?
- Why do we need to specify the column size when passing a 2D array as a parameter?
- How does GCC implement variable-length arrays?
- Pointer address in a C multidimensional array
- No compiler error when fixed size char array is initialized without enough room for null terminator
- Performance of 2-dimensional array vs 1-dimensional array
- Malloc a 3-Dimensional array in C?
- initializing an array of ints
- Need help using qsort with an array of structs
- Changing array inside function in C
- Miscalculation of array size inside a function
- Are a, &a, *a, a[0], &a[0] and &a[0][0] identical pointers?
- C char array initialization: what happens if there are less characters in the string literal than the array size?
- Resizing an array with C
- Array of structs replacing values over itself
- Pointer expressions: **ptr++, *++*ptr and ++**ptr use
- Difference between pointer to pointer and pointer to array?
- 2D Array indexing – undefined behavior?