4 ms·
5. size_t doesn't necessarily have to be the width of an address. An address (say, a value of type void* or char) has to be able to refer to any byte of any obj
by _kst_ 12y ago
5. size_t doesn't necessarily have to be the width of an address. An address (say, a value of type void* or char) has to be able to refer to any byte of any object. A size_t only has to be able to represent the size of any single* object. The limit on the size of a single object and the limit on the total size of memory are often the same on modern systems, but C allows them to be different (think segments).
6. size_t is required to be unsigned.
9. C requires wraparound behavior for unsigned integers.
10, 11, 12. It's not just the result of an overflowing signed integer arithmetic operation that's undefined, it's the behavior. `INT_MAX + 1` can yield `INT_MIN`, or it can yield 42, or it can crash your program and reformat your hard drive (at least in principle).
- ericfontaine 12y agoI forgot about segments... Thanks for clarifications...I guess I don't know C. :)