G
grocery_stocker
Why is it that you can subtract pointers, but you can't add them?
Why is it that you can subtract pointers, but you can't add them?
If you and I live on the same street, the difference of our
house numbers is some sort of indication of the distance
between our houses.
Now, you tell me, what meaning is there in the sum of our
house numbers?
Then there's the fact that in some places, they don't -have-
house numbers: addresses are descriptive, such as "110 metres north
of the tall tree east of the train station".
Hmm, you're at risk of starting a debate on how houses are numbered.Rouben said:If you and I live on the same street, the difference of our
house numbers is some sort of indication of the distance
between our houses.
Now, you tell me, what meaning is there in the sum of our
house numbers?
Walter Roberson wrote:
If we subtract the address of the place that is 110 metres north
of the tall tree east of the train station from the address
of the place that is 210 metres north
of the tall tree east of the train station,
we find that they are 100 meters apart.
grocery_stocker said:Why is it that you can subtract pointers, but you can't add them?
Only in places that the house numbers have been rationalized
at some point. Which is not the case in important parts of China
grocery_stocker said:Why is it that you can subtract pointers, but you can't add them?
> On 3 Jun 2005 03:51:29 GMT, in comp.lang.c ,
> (e-mail address removed)-cnrc.gc.ca (Walter Roberson) wrote: ....
>
> Even there, the difference between your house numbers tells you
> something about their relative location, provided you know something
> about the local numbering scheme.
Keith Thompson said:Adding two pointer values is neither meaningful nor useful. If you
think it is, try to construct a case where you could actually use the
result of such an operation.
grocery_stocker said:Why is it that you can subtract pointers, but you can't add them?
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.