Final answer:
In C, the expression -1[p] compiles and evaluates to the value -3 because array indexing in C is done using pointer arithmetic.
Step-by-step explanation:
In C, the expression -1[p] compiles and evaluates to the value -3 because array indexing in C is done using pointer arithmetic. In C, the expression *(p + n) is equivalent to array[n], where p is a pointer and n is the index you want to access. This is the reason why -1[p] compiles and works as expected.
When the expression -1[p] is evaluated, it can be rewritten as -*(p + 1). Here, p + 1 is equivalent to &array[1] + 1, which points to the next element in the array (which is array[2]). So, -*(p + 1) is equivalent to -array[2], which evaluates to -3.
It's worth noting that this syntax is not commonly used and can be confusing. It's generally recommended to use the more readable syntax array[n] instead of *(p + n) or n[p].