> I found a weird behaviour of gcc. I don't know if it's normal, and I'd like
> someone more "in the know" than me to explain :)
>
The behaviour is correct.
A reference can only be initialized once
> int &ref = sInc;
This initialized ref to be an alias of sInc.
> ref = sDec;
This assignes the value of sDec to ref (and thus also to sInc).
> Am I dumb if I think it should be different or it's a bug in our gcc ?
well, the compiler is doing the correct thing ;)
regards
Marcus
Machen Sie aus 14 Cent spielend bis zu 100 Euro!
Die neue Gaming-Area von Arcor - über 50 Onlinespiele im Angebot.
http://www.arcor.de/rd/emf-gaming-1