Facing problem while passing a function as a parameter in sort function in a class

It is showing me error in my code if I use a class.

Can you please help me in explaining that what is the error & how to solve it.

Please explain the error in my code with giving the solution to fix it.

My Code -> https://ide.codingblocks.com/s/361290

Also can you explain how can I call another fuction from a function within same class😊

hello @Shivam01
if u want to define compare function iniside class then u need to delcare it as static.

just call like u call any simple function

Tyanx for explaining AMAN :slight_smile:

Correction to revious comment -> *Thanx