Question: i have 

```
 class c1{

public:
    int number;

    c1()
    {
        number=rand()%10;
    }

    bool operator < (c1 *w)
    {
        return number < w->number;
    }

};

vector<c1*> vec = { ... }
sort(vec.begin(),vec.end()) 

```

why it dosent sort ?

but if we had 

```
 bool operator < (c1 w)
    {
        return number < w.number;
    }

```

and

```
vector<c1> vec = { ... }

```

it would have been sorted !

Answer: 
To answer your title question, you can't.

Pointers are built-in types, you cannot override operators where all operands are built-in types.

Luckily, there's an overload of `std::sort` that allows you to specify a comparison function (or functor) so the `operator<` isn't used.
`bool operator < (c1 *w)` compares a `c1` to a `c1 *` - Your sort compares a `c1 *` to a `c1 *`