Re: Defining address's offset.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Ian Lance Taylor <ian@xxxxxxxx> writes:

> For example, given
>     char *p;
>     void foo() { p++; }
> Then it is correct for p to be incremented by 4 on a machine with
> 32-bit addresses and 8-bit bytes.

But, whoops, I got the example wrong.  I should have said

    int *p;
    void foo() { p++; }

Then p might have the value, e.g., 0x100 before calling foo, and x0104
after.

Sorry for the confusion.

Ian

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux