Pointer comparison is constrained by the array object containing the pointed-to elements. Relational operators such as <, <=, >=, and > are valid only when both pointers point into the same array; otherwise, the operation itself can be erroneous. section 15.1.1
TAKEAWAY:
- Do not treat pointers as unrestricted integers: address-space representation can impose stricter comparison rules. section 15.1.1
- Keep pointer comparisons within one array object, just as pointer subtraction must remain within one array. section 15.1.1
- Prefer array indexing when expressing access to a specific element; compilers may detect invalid indices more readily than explicit pointer arithmetic. section 15.1.1
