Why doesn't the code "a[i] = i++;" work?
Answers were Sorted based on User's Feedback
Answer / guest
The variable i is both referenced and modified in the same
expression.
| Is This Answer Correct ? | 11 Yes | 4 No |
Answer / 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 |
Answer / vignesh1988i
this line will work.... first the value of i will be in the array and then i will get incremented
| Is This Answer Correct ? | 11 Yes | 18 No |
What is Full Form of C and Why We use C
Write a Program to find whether the given number or string is palindrome.
Can a function argument have default value?
Why array is used in c?
How old is c programming language?
What is indirect recursion? give an example?
With the help of using classes, write a program to add two numbers.
What is the size of structure in c?
Can you please explain the difference between malloc() and calloc() function?
Under what circumstances does a name clash occur?
What does c mean in basketball?
can anyone suggest some site name..where i can get some good data structure puzzles???