I made union of two strings with letters. I need to write function in C++ which sort letters in union.
union is "acefd"
I need result "acdef"
Could someone help how to write the function for this in C++?
There are lots of sort algorithms -- google for "bubble sort", which is the easiest one to write. Or you could use cl++ std::sort function.
std::string s = "acefd";
I must not use finite function like that you write me,I need to write function step by step which works for alphabetic sorting in C++...
Ancient Dragon's other suggestion was to do a google search for Bubble Sort - try that and you will get plenty of good links which describe how the algorithm works