I am looking at some old code of mine that manipulates data buffers. I have many places that have:
char *ptr1 ;
char *ptr2 ;
And then I need to find the number of bytes between the two.
int distance = ptr2 - ptr1 ;
I am getting a lot of warnings about truncation. What is the type of
ptr2 - ptr1
I have found a number of answers dealing with pointer arithmetic but, oddly not an answer to this particular question.