On 3/19/07, Paul D. Ouderkirk <[EMAIL PROTECTED]> wrote:
On 3/19/07, Gustavo Rios <[EMAIL PROTECTED]> wrote:
> No!
>
> p sizeof is 4 bytes, p is the frst byt of &x, and p + 1 is the 4th
> byte. Casting is only on attribution of &x to p.
>
> Realize, p[0] evals to 1 and p[1] evals to 2 as it should be. Only
> problem relates to p[0] * p[1]. I believe it should (1 * 2), i.e., 2.
> Not a random value.

For what it's worth, when I run this code I always get the same
(presumably correct) values:


And because I love to reply to myself, if I compile it with -O3, I can
reproduce your results:

[EMAIL PROTECTED]:~ $ cc -O3 test.c
[EMAIL PROTECTED]:~ $ ./a.out
x:8589934593
0,1:1,2
c:1387628864   (value of c changes with every execution)

--
------------------------------
Paul D. Ouderkirk
Senior UNIX System Administrator
JadedPixel Technologies
[EMAIL PROTECTED]
------------------------------
laughing,
in the mechanism
-- William Gibson

Reply via email to