What is difference between our usual pointers(ones which we normally use), near pointers and far pointers and is there a practical usage for near and far pointers in present day C/C++ systems? Any practical scenario which necessiates use of these specific pointers and not other c,c++ semantics will be very helpful.
What is difference between our usual pointers(ones which we normally use), near pointers and
Share
The near and far keywords have their origin in the segmented memory model that Intel had before. The near pointers could only access a block of memory originally around 64Kb in size called a segment whereas the far pointers could go outside of that range consisting of a segment and offset in that segment. The near pointers were much faster than far pointers so therefore in some contexts it paid off to use them.
Nowadays with virtual memory near and far pointers have no use.
EDIT:Sorry if I am not using the correct terms, but this is how I remembered it when I was working with it back in the day 🙂