> On Wed, 28 Apr 1999, Glynn Clements wrote:
> 
> # > In gcc,
> # > 
> # > if i = 2;
> # > then j = i++ + ++i;
> # > 
> # >   what is the value of j.
> # 
> #     i++ == 2
> #     ++i == 3
> # =>  j   == 5
> 
> no. it's not. I typed this in:
> 
> main() { int i = 2; printf ("%d", i++ + ++i);}
> and when i ran it i got 6 printed...
> 

It's probably compiler dependent.  I did the same thing:  
        main()  
        {
         int i=2; 
         int j=i++ + ++i; 
         i=2; 
         printf("%d %d\n",j,i++ + ++i);  
        }
and it prints out 5 5.

Reply via email to