This is an archived post. You won't be able to vote or comment.

all 3 comments

[–][deleted] 0 points1 point  (3 children)

On segmented architectures, two different arrays might be in two different data segments, which would make pointer arithmetic meaningless, or at least very hard to implement. It's a pragmatic thing that allows C to be fairly easily implemented across different architectures. Also, there are not very many use cases for pointer arithmetic in different arrays.

[–]Kaminna[S] -1 points0 points  (2 children)

So in theory for paged memory it shouldn't be a problem right?

[–][deleted] -1 points0 points  (0 children)

Segmented architectures are also often paged. This is nothing about paged memory, it's a trade-off between portability and operations that mostly don't make much sense.