R – the correct way to declare a pointer to a __far pointer

c++embeddedpointers

On an embedded target I use far pointers to access some parts of the memory map.

near pointer (without explicitely specifying __near):

unsigned int *VariableOnePtr;

Pointer to near pointer:

unsigned int **VariableOnePtrPtr;

far pointer:

unsigned int *__far VariableTwoPtr;

What is the correct way to declare a pointer to a far pointer? Does this pointer have to be a far pointer itself?

Best Solution

I believe you would do this:

unsigned int * __far *VariableThreePtrPtr;

A far pointer to a far pointer would be:

unsigned int * __far * __far VariableFourPtrPtr;