Sort the words by length in ascending order in c code example
Example: write a c++ program that reads ten strings and store them in array of strings, sort them and finally print the sorted strings
void sortString(string &str)
{
sort(str.begin(), str.end());
cout << str;
}
// Driver program to test above function
int main()
{
string s = "geeksforgeeks";
sortString(s);
return 0;
}