how to sort string array in c++
#include <iostream>
#include <algorithm>
#include <string>
int main() {
const int SIZE = 5;
std::string arr[SIZE] = {"apple", "orange", "banana", "grape", "kiwi"};
std::sort(arr, arr + SIZE);
for (int i = 0; i < SIZE; ++i) {
std::cout << arr[i] << " ";
}
return 0;
}