Consider the following variable definitions:
int x = 2;
int arr[10] = {4, 5, 6, 7, 1, 2, 3, 0, 8, 9};
int *p;
And assume that p is initialized to point to one of the integers in arr. Which of the following statements are legitimate? Why or why not?
1) p = arr; arr = p; p = &arr[2]; p = arr[x]; p = &arr[x]; arr[x] = p; 2) arr[p] = x; &arr[x] = p; p = &arr; x = *arr; x = arr + x; 3) p = arr + x; arr = p + x; x = &(arr+x); p++; x = --p; x = *p++; 4) x = (*p)++; arr++; x = p - arr; x = (p>arr); arr[*p]=*p; *p++ = x; 5) p = p + 1; arr = arr + 1;