In statistic, when a set of values is sorted in ascending or descending order, its median is the middle value. If the set contains an even number of values, the median is the mean, or average, of the two middle values. Write a function that accepts as arguments the following:
a) An array of integers.
b) An integer that indicates the number of elements in the array.
The function should determine the median of the array. This value should be returned as double. (Assume the values in the array are already sorted).
Demonstrate your program prowess by using pointer notation instead of array notation in this function.