Recently, I wrote some code to compare pointers like this:

```
if(p1+len < p2)

```

however, some staff said that I should write like this:

```
if(p2-p1 > len)

```

to be safe.
Here,*p1* and *p2* are `char *` pointers,*len* is an integer.
I have no idea about that.Is that right?

EDIT1: of course,*p1* and *p2* pointer to the same memory object at begging.

EDIT2：just one min ago,I found the *bogo* of this question in my code(about 3K lines),because `len` is so big that `p1+len` can't store in 4 bytes of pointer,so *p1+len < p2* is *true*.But it shouldn't in fact,so I think we should compare pointers like this in *some situation*:

```
if(p2 < p1 || (uint32_t)p2-p1 > (uint32_t)len)

```