+ 3
Why compiler compiles from right side?
My teacher, in my school ,told me that the compiler compiles a cout statement from right eg:- //some code B=67; cout<<"@"<<--B; cout<<"@"<<char(B+1)<<++B; //output @66@D67 in this case the program first decrements the value of B by 1 then in the next line it starts from right increments the value prints the value of char(B+1) which becomes D otherwise it should be C... can anyone explain me this why compiler compiles from right side..? https://code.sololearn.com/c8GjK6moEOys/?ref=ap
3 Antworten
+ 3
Using the ++ or -- operators in a cout statement is very unpredictable.
Another example. This was discussed in comments.
https://code.sololearn.com/cBg3yJKuyCM9/?ref=app
+ 3
yeah in CPP droid it shows me C instead of D