I have included the answer (provided by my professor) below. However, i don’t really understand. Please explain to me! Thank you.
Given the C++ function prototype and variable declarations:
int func(int arg0, int *arg1, int arg2);
int *ptr, n, arr;
which of the following statements will cause syntax errors or warnings about type mismatch/missing cast? For each case, write either BAD (error or warning), or OK (no error or warning), and circle also *all* the argument/variables that have type mismatches. No points will be awarded for a statement if there is a syntax error and you circle the wrong argument/variable.
The answer is:
ptr[n] = func(arr, &arr[n], n); OK
*ptr = func(arr[*ptr], &n, ptr); BAD (3rd arg: ptr is not an integer)