near
, far
, and huge
pointers are non-standard.
In implementations that support them (usually for very old x86 systems), a specific location in memory can be specified by a segment and an offset. A near
pointer contains only an offset, leaving the segment implicit. Thus it requires less space than a far
pointer.
Modern compilers do not use any of these keywords. I suggest you find yourself a newer compiler; there are plenty of free ones available.
See this question for more information.
Incidentally, printf's "%d"
format requires an argument of type int
; sizeof
yields a result of type size_t
, which is a different type. You can change your printf
call to:
printf("%d, %d, %d\n", (int)sizeof ptr1, (int)sizeof ptr2, (int)sizeof ptr3);
(The modern way to do that is:
printf("%zu, %zu, %zu\n", sizeof ptr1, sizeof ptr2, sizeof ptr3);
but an implementation that supports near
and far
pointers isn't likely to be modern enough to support "%zu"
, which was introduced in C99.)