From Philip's code
Code:
struct sort_between_underscores
{
    int ToInt(const std::string& str)
    {
        int x;
        std::stringstream ss(str);
        ss >> x;
        return x;
    }

    int BetweenUnderscores(const std::string& fname)
    {
        std::string::size_type pos1 = fname.find("_");
        std::string::size_type pos2 = fname.find("_",pos1+1);
        return ToInt(fname.substr(pos1+1,pos2-pos1-1));
    }

    bool operator () (const std::string& lhs, const std::string& rhs)
    {
        return BetweenUnderscores(lhs) < BetweenUnderscores(rhs);
    }
};
How can i edit so that it is not sort between underscores....
I wanted it to sort by strcmp. Can it be done?

Thanks.....