Answer:
C++.
Explanation:
Dynamic array consists of a pointer that, by default, points to the first element of the array. If the array name is foo, its first element's value can be accessed through foo[0] or *foo and foo[1] or *(foo + 1) and so on.
To find out if pointer ptr is pointing to any element of the intArray, we need to access each array element's address. We can do that by removing the asterisk from the element i.e. (foo + 1).
////////////////////////////////////////////////////////////////////////////////////
int withinArray(int * intArray, int size, int * ptr) {
for (int i = 0; i < size; i++) {
if (ptr == (intArray + i)) {
return 1;
}
return 0;
}