I was reading “Bjarne Stroustrup’s C++ Style and Technique” FAQ where he mentioned about this FAQ
What’s the value of i++ + i++?
In this he has mentioned “…the order of evaluation of function arguments are undefined.” when he is refering to f(v[i],i++); example.
I am aware of that the order of evaluation of function arguments is unspecified not undefined but in this case is it undefined because we are relying on value of i so as to which v[i] to pass or its an error in the FAQ itself?
The order of evaluation of function arguments is unspecified but the behaviour of the expression is undefined. Bjarne has just got it wrong. 🙂
Check out this thread to understand the difference between Unspecified Behaviour and Undefined Behaviour.
I once asked Bjarne the difference between
unspecifiedandundefinedand this was his reply..