The difference between near and far in C + +
the keywords near and far are affected by the target computer architecture. The current programming is not much used.
The NEAR keyword creates a target pointer to the low-end portion of the addressable memory. These pointers take up a single byte of memory, and they can point to a memory unit that is limited to a four-position, usually in the 0X0000~0X00FF range.
int near * ptr;
The FAR keyword creates a pointer that can point to any data in memory:
char FAR * ptr;
Near ( nearly ) pointer: offset Address in the four-bit segment
Far ( farther ) pointer: The address of the four-bit segment + the offset address in the
Huge ( giant ) pointer: a unique memory address normalized by the
The storage properties of the C language are determined by six compilation modes ( see the option->compiler->model option in the TC Integrated Environment menu ), and the default compilation mode is Small, in this compilation mode, the pointer's default property is near.
Add: The near pointer is a 16-bit pointer, relying on a segment address register, the pointer variable is the amount of displacement, using the segment address register + pointer addressing, so there is a limit of 64K.
far pointer is 32 bit pointer, There are not only 16 bit displacement, and 1616ffff
so, with the introduction of the huge pointer, thehuge pointer, like far , differs only by using a standardized method, so that all addresses have a unique representation, thus avoiding the problem of the far pointer.
The null pointer specifies a pointer state, if there is no null pointer, as the number is not 0.
The difference between near and far in C + +