Memory-model modifiers can be used when declaring objects to explicitly specify addressing. A memory-model modifier affects the token immediately to its right. The declaration of pointers provides a good example of how this works. Consider the following declarations:
char __far *lpchObject; // Declaration 1
char * __far pchlFarPointer; // Declaration 2
char __far * __far lpchlFarObject; // Declaration 3
In the first declaration, the keyword __far modifies the token *, making lpchObject a pointer in the default data segment to a “far” object—an object accessed with a 32-bit segment:offset address.
In the second declaration, the keyword __far modifies the pchlFarPointer token. This modification makes pchlFarPointer a pointer that is not necessarily in the default data segment that refers to an object of type char in the default data segment. It declares a far-allocated pointer to a near object.
In the third declaration, the keyword __far is used twice: once to modify the pointer and once to modify the object. Therefore, it declares a far-allocated pointer to a far object.