Why doesn't the code "a[i] = i++;" work?

Answer Posted / abdur rab

The answer from wikipedia

Sequence point comes into play when the same variable is
modified more than once. An often-cited example is the
expression i=i++, which both assigns i to itself and
increments i; what is the final value of i? Language
definitions might specify one of the possible behaviors or
simply say the behavior is undefined. In C and C++,
evaluating such an expression yields undefined behavior.

Is This Answer Correct ?    6 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the benefit of using #define to declare a constant?

609


What are valid signatures for the Main function?

702


Are enumerations really portable?

596


What is the difference between functions abs() and fabs()?

651


What does it mean when a pointer is used in an if statement?

602






explain how do you use macro?

668


What are variables and it what way is it different from constants?

787


What is c method?

537


What is calloc malloc realloc in c?

594


please send me the code for multiplying sparse matrix using c

1728


What is #include called?

570


Can we add pointers together?

621


Explain how does free() know explain how much memory to release?

575


Why should I use standard library functions instead of writing my own?

675


What are the types of type specifiers?

623