Sequence Point

A sequence point defines any point in a computer program's execution at which it is guaranteed that all side effects of previous evaluations will have been performed, and no side effects from subsequent evaluations have yet been performed. They are often mentioned in reference to C and C++, because the result of some expressions can depend on the order of evaluation of their subexpressions. Adding one or more sequence points is one method of ensuring a consistent result, because this restricts the possible orders of evaluation.

With C++11, the most recent iteration of the C++ programming language, usage of the term sequence point has been replaced by specifying that either one evaluation is sequenced before another, or that two evaluations are unsequenced. The execution of unsequenced evaluations can overlap.

Read more about Sequence PointExamples of Ambiguity, Sequence Points in C and C++

Other articles related to "sequence point, sequence points":

C Syntax - Miscellaneous - Undefined Behavior
... behavior, because the variable b is modified more than once with no intervening sequence point #include int main(void) { int a, b = 1 a = b++ + b++ printf("%dn", a) return 0 } Because there is no ... This can be fixed by rewriting the code to insert a sequence point in order to enforce an unambiguous behavior, for example a = b++ a += b++ or a = (b += 2) ...
Sequence Points in C and C++
... In C and C++, sequence points occur in the following places ... functions, and thus operators that have been overloaded introduce sequence points in the same way as function calls.) Between evaluation of the left and right operands of the (logical AND ... For example, in the expression a = (*p++) ? (*p++) 0 there is a sequence point after the first *p++, meaning it has already been incremented by the ...

Famous quotes containing the words point and/or sequence:

    At some point in life the world’s beauty becomes enough. You don’t need to photograph, paint or even remember it. It is enough.
    Toni Morrison (b. 1931)

    We have defined a story as a narrative of events arranged in their time-sequence. A plot is also a narrative of events, the emphasis falling on causality. “The king died and then the queen died” is a story. “The king died, and then the queen died of grief” is a plot. The time sequence is preserved, but the sense of causality overshadows it.
    —E.M. (Edward Morgan)