Compare function

How to use Compare function to sort the strings ?

to use your compare function you have to pass it as third parameter in stl sort function .
This compare function returns a value; convertible to bool, which basically tells us whether the passed “first” argument should be placed before the passed “second” argument or not.

then how can i modify my compare function ?

@StreamerX, refer this code :- https://ide.codingblocks.com/s/241662