views:

140

answers:

2

I have the following definition.

far int* near IntegerPointer;

Does this mean, a pointer placed in 'near' memory pointing to a integer placed in far memory area.

Can anyone please clarify.

A: 

[psyhic power on] Yes you are right. :) [psyhic power off]

Just simple

@far int* IntegerPointer;

would be just pointer to far memory, whereas

int* @near IntegerPointer;

looks like pointer placed in near memory.

Michal Sznajder
+2  A: 

Yes, you got that right.

Read declarations (from the inside out and) from right to left:

@far int* @near IntegerPointer;
                ^^^^^^^^^^^^^^

IntegerPointer is a

@far int* @near IntegerPointer;
          ^^^^^

IntegerPointer is a @near

@far int* @near IntegerPointer;
        ^

IntegerPointer is a @near pointer

@far int* @near IntegerPointer;
     ^^^

IntegerPointer is a @near pointer to int

@far int* @near IntegerPointer;
^^^^

IntegerPointer is a @near pointer to int @far
or IntegerPointer is a @near pointer to @far int

What @near and @far means, though, I have almost no idea.

pmg
Different addressing methods, I think.
GMan
Windows C compilers used to have near and far pointers, being (IIRC) 16 and 32 bits respectively. I don't know why the "@" either, since it isn't in the body of the question.
David Thornley