#include <iostream>
#include <algorithm>

class StrCmp
{
public:
    template <typename T> bool operator()
        (const T* p1, const T* p2) const
    {
        while (*p1 && *p2 && *p1 == *p2)
            ++p1, ++p2;

        return *p2 - *p1 > 0;
    }
};

int main(int argc, char* argv[] )
{
    const unsigned int* a[]
    {
        (const unsigned int*)"Сидоров",
        (const unsigned int*)"Петров",
        (const unsigned int*)"Иванов",
        (const unsigned int*)"Аров",
        (const unsigned int*)"Аро",
        (const unsigned int*)"",
    };

    std::cout << StrCmp()(a[2],a[5]) << std::endl;
    std::cout << StrCmp()(a[5],a[2]) << std::endl;

    return 0;
}

