Program to sort string in descending order | CPP program to sort a string in descending order using library function ; Driver code ; descOrder ( s ) ; function call
#include <bits/stdc++.h> NEW_LINE using namespace std ; void descOrder ( string s ) { sort ( s . begin ( ) , s . end ( ) , greater < char > ( ) ) ; } int main ( ) { string s = " geeksforgeeks " ; return 0 ; }