This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Advice on Pointer arithmetic please?

Could anyone enlighten me on pointer arithmetic please?

Assigning a constant is fine, but a warning is generated when using a variable. (The code does do what I expect though.)

The warning is :
'long' converted to 'xhuge' pointer

void Test()
{
long x;
char xhuge *ptr;
x=2;

ptr = 0x80000 + 0x01;   // no-warning
ptr = 0x80000 + x;      // warning generated
x = 0x80000;
ptr += x;		// no-warning
ptr = x;                // warning generated
}


Andy

0