Answer the question
In order to leave comments, you need to log in
How to sort an array by Unicode?
Initial array: [1, "Goose", 14, "gas", /, "file10", "file11"];
Sorted array: [/, 1, 14, "Goose", "file10", "file11", "gas"];
What sorting algorithm should be used? If it's not difficult, then throw links to the desired algorithm or throw off a whole piece of the algorithm, if you used it ...
Answer the question
In order to leave comments, you need to log in
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
using namespace std;
int main()
{
vector<wstring> words = { L"1", L"Goose", L"14", L"gas", L"/" , L"file10", L"file11" };
sort(words.begin(), words.end());
for(auto s : words)
{
wcout << s << " ";
}
wcout << endl;
wcin.get();
}
OUT: / 1 14 Goose file10 file11 gas
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question