Possible Duplicate:
Undefined Behavior and Sequence Points
Pleae explain the behaviour of following statements
int b=3;
cout<<b++*++b<<endl;
How will it be calculated?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The behavior here is undefined. See this question
Relevant standard quote:
§5/4.1 Between the previous and next sequence point a scalar object shall have its stored value modified at most once by the evaluation of an expression.The most common sequence point is the end of a statement.
Also worth noting from the standard:
§5.2.2/8 The order of evaluation of arguments is unspecified.