In a contiguous array comparing memory offsets (pointers) is OK. If your array is implemented as a linked list (for example) the nodes could be all over memory so pointer comparison is nonsensical.
1
votes
Yes, they can be compared.
For example, see "Relational Operators" in standards for further information, 6.5.8 in C99, and 5.9 in old draft of C++ (2006-11).
We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.OkRead more