3 ms·
Nope. It's 32 and 64, but it's a signed type (which is why it isn't equivalent to size_t). The range of possible values is still of size 2^32 or 2^64, it's just
by gjm11 11y ago
Nope. It's 32 and 64, but it's a signed type (which is why it isn't equivalent to size_t). The range of possible values is still of size 2^32 or 2^64, it's just centred at 0.
[EDITED to add: Having said which, the above isn't really any wronger than the OP which is full of mistakes.]
- pmalynin 11y agoWhat I meant to say is that the text for size_t and ptrdiff_t are identical, implying that the underlying types are identical. That is there is logical fallacy. They author states "The type’s size is chosen so that it could store the maximum size of a theoretically possible array of any type" and the same is said for ptrdiff_t, which is quit confusing. Now I realise that in reality they both use 64 bits, it is somewhat strange to use the same text for both.
- gjm11 11y agoYeah, the article is just terrible, and when it says a ptrdiff_t can store the size of any object it's completely wrong.