#include <iostream>
#include <algorithm>
using namespace std;
// define compare function to compare between char i and j
_____________________{ // Line-1: Write proper function header
_____________________; // Line-2: Write correct function body
}
int main() {
char data[5];
for (int i = 0; i < 5; i++)
cin >> data[i];
sort(data, data + 5, compare);
for (int i = 0; i < 5; i++)
cout << data[i] << " ";
return 0;
}
In the above code what will be in LINE1 and LINE2 ,
sort(data, data + 5, compare);
in this why its taking the compare function, and I checked or compare function in c++ it takes two strings as arguments but here its not passing any arguments