If I have the following expression:
c = (a) * (b)
What does the C90 standard say about the order evaluation of the subexpression ‘a’ and ‘b’?
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.
There is no specified order since the multiplication operator is not a sequence point. Sequence points include the comma operator, the end of a full expression, and function calls. Thus the order of evaluation of
(a)and(b)is up to the compiler implementation. Therefore you shouldn’t attempt to-do something in(a)that would have a side-effect that you want to be seen in(b)in order to generate a valid result.For instance:
If you want a full-listing of sequence points for C, you can check out a more thorough reference here.