Sorting Array Elements Using Pointers As Function