This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: scope issue
- To: dvv at dvv dot org (Dima Volodin)
- Subject: Re: scope issue
- From: patrick <patrick at mail dot boxsoft dot com>
- Date: Mon, 23 Aug 1999 21:25:08 -0700 (PDT)
- Cc: gcc at gcc dot gnu dot org (gcc list (aka egcs))
sometime in the late 1900s Dima replied to Richard:
> Richard Harvey Chapman wrote:
>
> > Is there a correct output for the following?
>
> No, there isn't.
i can understand your answer for the second printf() but not
for the first one.
i think the first one should always give 9 (in this case).
what am i missing?
> > int main ( void )
> > {
> > int x=9;
> >
> > printf ("%d\n", (x + x++) - --x);
> > printf ("%d %d\n", ++x, x++);
> > }
> >
> > I believe that it should be:
> > 9
> > 10 10
> >
> > but different compilers have given different answers.
> >
> > R.
>
> Dima
patrick at boxsoft dot com
sidster at drink dot com
--
The rain it raineth on the just
And also on the unjust fella,
But chiefly on the just, because
The unjust steals the just's umbrella.