retagged by
591 views
1 votes
1 votes

What are sequence Points ....?

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. A sequence point is a point in program execution at which all side effects are evaluated before going on to the next step

               -sounce : Wikipedia 

Q ] Please show a working example and explain the statement . Not able to understand the lines correctly .
Q ] Could introduction Sequence Points in code solve the problem of undefined behaviour  of the following statement ? If so explain how it is done 

printf("%d , %d , %d ",i++,i,++i);

  

retagged by

Please log in or register to answer this question.

Related questions

21 votes
21 votes
1 answer
1
Arjun asked Aug 8, 2016
8,173 views
What will be the output of the following code?#include<stdio.h int main() { int x=10, y; y = (x++) + (++x); printf("%d %d %d %d ", y, x++, x, ++x); }22,10,11,1322,11,11,1...
0 votes
0 votes
1 answer
2
Ankush Tiwari asked Aug 20, 2016
469 views
#include<stdio.h int main() { char *p1="xyz"; char *p2="xyz"; if(p1==p2) printf("equal"); else printf("unequal"); }Output is equal how??? please explain
2 votes
2 votes
1 answer
3
Registered user 7 asked Aug 19, 2016
542 views
#include<stdio.h #include<stdlib.h int main() { int p=9; printf("%d %d",p++,++p); } how it executed and also how printf function executed left to right or right to left?
1 votes
1 votes
1 answer
4
komal07 asked Aug 18, 2016
1,061 views
#include<stdio.h #define CUBE(x) (x*x*x) int main() { int a, b=3; a = CUBE(b++); printf("%d, %d ", a, b); return 0; }Why this give 27,6 as output?