I have used the following code to sort files in alphabetical order and it sorts the files as shown in the figure:
for(int i = 0;i < maxcnt;i++)
{
fo
Taking into account that this has a c++ tag, you could elaborate on @Joseph Quinsey's answer and create a natural_less function to be passed to the standard library.
using namespace std;
bool natural_less(const string& lhs, const string& rhs)
{
return strcasecmp_withNumbers(lhs.c_str(), rhs.c_str()) < 0;
}
void example(vector& data)
{
std::sort(data.begin(), data.end(), natural_less);
}
I took the time to write some working code as an exercise https://github.com/kennethlaskoski/natural_less