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 double pointer in c?

574


general for is %wd,f-d; in this system "w" means a) 'w' represent total width of digits b) 'w' represent width which includes the digits before,after decimal place and the decimal point c) 'w' represent width which includes the digits before only d) 'w' represent width after decimal place only

576


Can you think of a logic behind the game minesweeper.

1995


a c code by using memory allocation for add ,multiply of sprase matrixes

2288


What are types of functions?

553






When should structures be passed by values or by references?

570


In c language can we compile a program without main() function?

564


find the value of y y = 1.5x+3 for x<=2 y = 2x+5 for x>2

1519


What is call by value in c?

545


What is the use of extern in c?

635


Explain the use of keyword 'register' with respect to variables.

582


What is the difference between printf and scanf )?

581


Explain the difference between the local variable and global variable in c?

587


Hai what is the different types of versions and their differences

1478


What does the format %10.2 mean when included in a printf statement?

1071