Как я могу вызвать sortArrays () со встроенным массивом строк, чтобы я мог отсортировать массив в функции sortArray в C ++? - PullRequest
0 голосов
/ 01 февраля 2020
// void sortArrays(). Call sortArrays() with a built-in array of strings and a Class Template array //object of strings. Sort both. 

int main() {

string colors[]{ "red", "blue", "violet", "yellow", "orange", "green", "indigo"};

cout << "\n\nUnsorted array of colors:\n" << endl;
for (string color : colors) {
    cout << color << " ";
}

sort(begin(colors), end(colors));

cout << "\n\nSorted array of colors:\n" << endl;
for (string color : colors) {
    cout << color << " ";
}

return 0;
}
...