which way ANSI C specified for x = (++i) + (++i) + (++i) + (++i);

Ffoobarr fubar@example.com
Wed Oct 20 13:11:00 GMT 1999


On 20 Oct 1999 11:48:49 -0700, Steven Wu <wus@goodnet.com> wrote:
>the program is:
>
>#include <stdio.h>
>{
>  int i = 3, x;
>
>  x = (++i) + (++i) + (++i) + (++i);
>  printf ("%d\n", x);
>}

The result is undefined and anything can happen.  You're lucky
it didn't cause demons to fly out your nose.



More information about the Gcc-help mailing list