You have to write a generic Compare function for sorting. For example, suppose there is a Student class containing marks of Subjects X,Y,Z. you have to write a compare function for sorting based on any field that the user wishes.
Hint: Use Function pointer