Generate an array that contains strings as elements. Sort this array in ascending order. (C++) Solution solution.cpp #include <iostream> //header file for input output function using namespace std; //it tells the compiler to link std arr2 space #include <cstring> //header file for string int main() { //main function // declare two arrays arr2d arr1 with 1-Dimension // and arr2 with 2-Dimension char arr1[10], arr2[10][10]; // normal variables... int i, j,noofstrings; cout<<\"Enter the number of strings required to sort \"; cin>>noofstrings; // for loop statement for(i=0; i<noofstrings; i++) { cout<<\"\ Enter the strings of an array \"<<(i+1)<<\": \"; cin>>arr2[i]; } for(i=0; i<noofstrings-1; i++) for(j = i+1; j<noofstrings; j++) //sorting string using strcmp() if(strcmp(arr2[i], arr2[j])>0) { // strcpy - copy the strings... // compare and swap... strcpy(arr1, arr2[i]); strcpy(arr2[i], arr2[j]); strcpy(arr2[j], arr1); } cout<<\"\ Sorted strings are:\ \"; for (i =0; i<noofstrings; i++) cout<<\"\ \"<<arr2[i]; cout<<endl; return 0; } output sh-4.3$ main Enter the number of strings required to sort 3 Enter the strings of an array 1: burningstar Enter the strings of an array 2: rockstar Enter the strings of an array 3: suddenstar Sorted strings are: burningstarockstar rockstar suddenstar .