#include<fstream>
#include<cstring>
using namespace std;
void print(char array[][16], int rows, int cols){
for(int i=0; i<rows; i++){
for(int j=0; j<cols; j++)
cout << array[i][j];
cout << endl;
}
}
void Sort(char array[][16], int rows, int cols){
char temp[16];
for(int i=0; i<rows; i++){
for(int j=i+1; j<rows; j++)
if(strcmp(array[i], array[j])<0){
strcpy(temp, array[i]);
strcpy(array[i], array[j]);
strcpy(array[j], temp);
}
}
}
int main(){
ifstream infile(“input.dat”);
char array[10][16];
int i=0;
if(!infile){
cout <<“unable to open file so exiting from program”<<endl;
return 0;
}
while(!infile.eof()){
infile >> array[i++];
}
cout << “Before Sorting ” << endl;
print(array, 10, 15);
Sort(array, 10, 15);
cout << “nAfter Sorting ” << endl;
print(array, 10, 15);
return 0;
}

Don't use plagiarized sources. Get Your Custom Essay on
Can you help me to making C++ programming? Sort a 10×15 array of characters. Largest located at index [0][0-14] and smallest at index [9][0-14]….
Get an essay WRITTEN FOR YOU, Plagiarism free, and by an EXPERT!