If i have a string is there a built in function to sort the characters or would I have to write my own?
for example:
string word = \"dabc\"; <
string word = \"dabc\";
You can use sort() function. sort() exists in algorithm header file
#include using namespace std; int main() { ios::sync_with_stdio(false); string str = "sharlock"; sort(str.begin(), str.end()); cout<
Output:
achklors